In Ubuntu, you can install Catch2 from the command line with ``sudo apt-get install catch2`` and it’ll put two library files into your /usr/lib: libCatch2.a and libCatch2Main.a. Library headers will also be put in the appropriate places.
Each test file you have (a something_test.cpp for example) will be built into its own program by linking against the two provided static libraries, for example: ``g++ something_test.cpp -o something_test -lCatch2 -lCatch2Main``.Within its source, such a test file must also include the catch2/catch_all.hpp installed header.
See:
The first page is a basic tutorial on how to use the library. The second mentions issues having to do with migrating to newer versions. It seems like the library was headers only in the past, which contributed to slower compilation times. Now, they moved into a static library (.a) model.
No comments:
Post a Comment