mirror of
https://github.com/triqs/dft_tools
synced 2024-12-23 04:43:42 +01:00
[cmake] Build gtest from test/c++/gtest and use gtest_main target
This commit is contained in:
parent
da55635d5c
commit
31433b69fb
@ -1,3 +1,6 @@
|
||||
# Build googletest
|
||||
add_subdirectory(gtest EXCLUDE_FROM_ALL)
|
||||
|
||||
# Copy h5 files to binary dir
|
||||
file(GLOB_RECURSE all_h5_ref_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.ref.h5)
|
||||
foreach(file ${all_h5_ref_files})
|
||||
@ -12,7 +15,7 @@ foreach(test ${all_tests})
|
||||
get_filename_component(test_dir ${test} DIRECTORY)
|
||||
add_executable(${test_name} ${test})
|
||||
set_property(TARGET ${test_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${test_dir})
|
||||
target_link_libraries(${test_name} app4triqs_c triqs::gtest project_warnings)
|
||||
target_link_libraries(${test_name} app4triqs_c gtest_main project_warnings)
|
||||
add_test(NAME ${test_name} COMMAND ${test_name} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${test_dir})
|
||||
# Run clang-tidy if found
|
||||
if(CLANG_TIDY_EXECUTABLE)
|
||||
|
@ -28,5 +28,3 @@ TEST(Toto, H5) { // NOLINT
|
||||
|
||||
EXPECT_EQ(a, a2); // NOLINT
|
||||
}
|
||||
|
||||
MAKE_MAIN; // NOLINT
|
||||
|
Loading…
Reference in New Issue
Block a user