File tree Expand file tree Collapse file tree 4 files changed +26
-19
lines changed Expand file tree Collapse file tree 4 files changed +26
-19
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,4 @@ include(CTest)
88
99include (cmake/compilers.cmake)
1010
11- set (CMAKE_C_STANDARD 99)
12- set (CMAKE_CXX_STANDARD 11)
13-
1411add_subdirectory (src)
Original file line number Diff line number Diff line change @@ -29,8 +29,14 @@ set_target_properties(c_fortran_struct PROPERTIES LINKER_LANGUAGE C)
2929target_compile_definitions (c_fortran_struct PRIVATE $<$<BOOL :${MSVC} >:_CRT_SECURE_NO_WARNINGS>)
3030add_test (NAME C_Fortran_struct COMMAND c_fortran_struct)
3131
32- set_tests_properties (
33- C_Fortran_error C_Fortran_struct C_Fortran_submodule
34- PROPERTIES
35- TIMEOUT 5
36- )
32+ # --- props
33+
34+ get_property (targets DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY BUILDSYSTEM_TARGETS)
35+
36+ foreach (t IN LISTS targets)
37+ target_compile_features (${t} PRIVATE c_std_99)
38+ endforeach ()
39+
40+ get_property (test_names DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS)
41+
42+ set_tests_properties (${test_names} PROPERTIES TIMEOUT 5)
Original file line number Diff line number Diff line change @@ -54,9 +54,14 @@ set_target_properties(cxx_fortran_struct PROPERTIES LINKER_LANGUAGE CXX)
5454target_compile_definitions (cxx_fortran_struct PRIVATE $<$<BOOL :${MSVC} >:_CRT_SECURE_NO_WARNINGS>)
5555add_test (NAME C++_Fortran_struct COMMAND cxx_fortran_struct)
5656
57+ # --- props
5758
58- set_tests_properties (
59- C++_Fortran_array C++_Fortran_vector C++_Fortran_error C++_Fortran_struct C++_Fortran_submodule
60- PROPERTIES
61- TIMEOUT 5
62- )
59+ get_property (targets DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY BUILDSYSTEM_TARGETS)
60+
61+ foreach (t IN LISTS targets)
62+ target_compile_features (${t} PRIVATE cxx_std_11)
63+ endforeach ()
64+
65+ get_property (test_names DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS)
66+
67+ set_tests_properties (${test_names} PROPERTIES TIMEOUT 5)
Original file line number Diff line number Diff line change @@ -51,9 +51,8 @@ add_test(NAME Fortran_C_error
5151COMMAND ${CMAKE_COMMAND} -Dexe=$<TARGET_FILE:fortran_c_error> -Dexp_code=42 -P ${PROJECT_SOURCE_DIR} /cmake/test_error.cmake
5252)
5353
54- set_tests_properties (
55- Fortran_C_vector Fortran_C_struct Fortran_C_error
56- Fortran_C++_vector Fortran_C++_struct Fortran_C++_error
57- PROPERTIES
58- TIMEOUT 5
59- )
54+ # --- props
55+
56+ get_property (test_names DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS)
57+
58+ set_tests_properties (${test_names} PROPERTIES TIMEOUT 5)
You can’t perform that action at this time.
0 commit comments