Add Catch2 test runner.
Add a Catch2 runner to the tests directory with a custom main()
which calls MPI_Init
, runs Catch2, and then calls MPI_Finalize
.
The layout should be:
tests
- catch2_runner.main.cpp
- CMakeLists.txt
The test/CMakeLists.txt
file should look like
add_subdirectory(../external/catch2 catch2)
add_library(catch2_runner ...)
...
From CMakeLists.txt
in the project root directory, a user should be able to do:
add_executable(my_file.test src/dimer/my_file.test.cpp)
target_link_libraries(my_file.test PRIVATE dimer catch2_runner)
to add a test using Catch2.