mirror of
https://github.com/triqs/dft_tools
synced 2024-12-26 14:23:38 +01:00
1517cdaaeb
- from now on, C++11 compilers only. - no ressources to maintain old stuff.
22 lines
640 B
CMake
22 lines
640 B
CMake
find_package(TestCSimple)
|
|
enable_testing()
|
|
|
|
option (TESTS_C_WITH_VALGRIND "Run all the tests also through valgrind" OFF)
|
|
|
|
macro(all_tests )
|
|
|
|
FILE(GLOB TestList RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
|
|
FOREACH( TestName1 ${TestList} )
|
|
STRING(REPLACE ".cpp" "" TestName ${TestName1})
|
|
add_executable( ${TestName} ${CMAKE_CURRENT_SOURCE_DIR}/${TestName}.cpp )
|
|
add_test_C_simple( ${TestName} )
|
|
if (TESTS_C_WITH_VALGRIND)
|
|
add_test ( ${TestName}_valgrind valgrind --error-exitcode=1 ${CMAKE_CURRENT_BINARY_DIR}/${TestName})
|
|
endif()
|
|
ENDFOREACH( TestName1 ${TestList} )
|
|
|
|
endmacro()
|
|
|
|
add_all_subdirectories_with_cmakelist()
|
|
|