File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 44# https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md#top
55
66find_package (Catch2 REQUIRED)
7- include_directories (${Catch2_INCLUDE_DIRS} ) # Add Catch2 include directories
87
98add_executable (openpfc-tests
109 runtests.cpp
@@ -16,16 +15,28 @@ add_executable(openpfc-tests
1615 test_discrete_field.cpp
1716 test_field_modifier.cpp
1817 test_ic_constant.cpp
18+ test_boundary_conditions.cpp
1919 test_model.cpp
2020 test_multi_index.cpp
2121 test_simulator.cpp
2222 test_time.cpp)
2323
24+ # Link against OpenPFC and Catch2
2425target_link_libraries (openpfc-tests PRIVATE OpenPFC Catch2::Catch2)
2526
27+ # Attach Catch2 include dirs manually for compile_commands.json
28+ get_target_property (_catch2_include_dirs Catch2::Catch2 INTERFACE_INCLUDE_DIRECTORIES )
29+ message (STATUS "Catch2 includes: ${_catch2_include_dirs} " )
30+ target_include_directories (openpfc-tests PRIVATE ${_catch2_include_dirs} )
31+ foreach (dir IN LISTS _catch2_include_dirs)
32+ target_compile_options (openpfc-tests PRIVATE "-isystem" "${dir} " )
33+ endforeach ()
34+
2635if (OpenPFC_ENABLE_CODE_COVERAGE)
27- target_compile_options (openpfc-tests PUBLIC --coverage)
28- target_link_options (openpfc-tests PUBLIC --coverage)
36+ # Enable code coverage if OpenPFC_ENABLE_CODE_COVERAGE is set
37+ message (STATUS "Enabling code coverage for tests" )
38+ target_compile_options (openpfc-tests PRIVATE --coverage)
39+ target_link_options (openpfc-tests PRIVATE --coverage)
2940endif ()
3041
3142# Disable automatic test discovery during the build
You can’t perform that action at this time.
0 commit comments