Make sure include directories are passed to test binaries

This commit is contained in:
Richard Berger
2020-05-21 15:02:37 -04:00
parent 8de046270e
commit 73b537f6c3

View File

@ -8,11 +8,11 @@ endif()
set(TEST_INPUT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/tests)
add_library(style_tests STATIC yaml_writer.cpp error_stats.cpp test_config_reader.cpp test_main.cpp)
target_compile_definitions(style_tests PRIVATE TEST_INPUT_FOLDER=${TEST_INPUT_FOLDER})
target_link_libraries(style_tests PRIVATE MPI::MPI_CXX Yaml::Yaml)
target_link_libraries(style_tests PUBLIC GTest::GTest GTest::GMock MPI::MPI_CXX Yaml::Yaml)
# pair style tester
add_executable(pair_style pair_style.cpp)
target_link_libraries(pair_style PRIVATE lammps GTest::GTest GTest::GMock style_tests)
target_link_libraries(pair_style PRIVATE lammps style_tests)
# tests for a molecular systems and related pair styles
file(GLOB MOL_PAIR_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/mol-pair-*.yaml)
@ -33,7 +33,7 @@ endforeach()
# bond style tester
add_executable(bond_style bond_style.cpp)
target_link_libraries(bond_style PRIVATE lammps GTest::GTest GTest::GMock style_tests)
target_link_libraries(bond_style PRIVATE lammps style_tests)
file(GLOB BOND_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/bond-*.yaml)
foreach(TEST ${BOND_TESTS})
@ -44,7 +44,7 @@ endforeach()
# angle style tester
add_executable(angle_style angle_style.cpp)
target_link_libraries(angle_style PRIVATE lammps GTest::GTest GTest::GMock style_tests)
target_link_libraries(angle_style PRIVATE lammps style_tests)
file(GLOB ANGLE_TESTS LIST_DIRECTORIES false ${TEST_INPUT_FOLDER}/angle-*.yaml)
foreach(TEST ${ANGLE_TESTS})