1include(RunCMake) 2 3function(run_GEH) 4 # Use a single build tree for a few tests without cleaning. 5 set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/GEH-build) 6 set(RunCMake_TEST_NO_CLEAN 1) 7 if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG) 8 set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug) 9 endif() 10 file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") 11 file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") 12 run_cmake(GEH) 13 run_cmake_command(GEH-build ${CMAKE_COMMAND} --build . --config Debug) 14 run_cmake_command(GEH-run ${RunCMake_TEST_BINARY_DIR}/GenerateExportHeader) 15 run_cmake_command(GEH-incguard-macro-run ${RunCMake_TEST_BINARY_DIR}/test_includeguard_macro) 16 run_cmake_command(GEH-incguard-custom-run ${RunCMake_TEST_BINARY_DIR}/test_includeguard_custom) 17 18 file(STRINGS "${RunCMake_TEST_BINARY_DIR}/failure_test_targets" 19 failure_test_targets) 20 21 foreach(failure_test_target ${failure_test_targets}) 22 run_cmake_command(GEH-link-error ${CMAKE_COMMAND} 23 --build . 24 --config Debug 25 --target ${failure_test_target}) 26 endforeach() 27endfunction() 28 29# remove these flags from the environment if they have been set 30# so the tests run the correct env 31set(env_cxx_flags $ENV{CXXFLAGS}) 32if(env_cxx_flags) 33 string(REPLACE "-fvisibility=hidden" "" env_cxx_flags "${env_cxx_flags}") 34 string(REPLACE "-fvisibility-inlines-hidden" "" env_cxx_flags "${env_cxx_flags}") 35 set(ENV{CXXFLAGS} "${env_cxx_flags}") 36endif() 37run_GEH() 38