Skip to content

Commit 3d983e7

Browse files
committed
Consolidate runtime environment modifications
1 parent 35c260b commit 3d983e7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tests/CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ add_library(util util.c)
2323
add_compile_definitions(REFERENCE_FILES_DIR=\"${REFERENCE_FILES_DIR}\")
2424
add_compile_definitions(FIXTURES_DIR=\"${FIXTURES_DIR}\")
2525

26+
set(runtime "WITH_CMAKE=set:YES;OBJC_DISABLE_INITIALIZE_FORK_SAFETY=set:YES;srcdir=set:${CMAKE_CURRENT_SOURCE_DIR};top_srcdir=set:${CMAKE_SOURCE_DIR};top_builddir=set:${CMAKE_BINARY_DIR}")
27+
2628
if (BASH_PROGRAM AND ENABLE_TESTING_SHELL)
2729
foreach(shell_file ${shell_files})
2830
file(REAL_PATH ${shell_file} shell_name)
2931
string(REGEX REPLACE ${ext_pattern} "" shell_name ${shell_file})
3032
add_test (${shell_name} ${BASH_PROGRAM} ${shell_file})
3133
set_property(TEST ${shell_name}
32-
PROPERTY ENVIRONMENT_MODIFICATION "OBJC_DISABLE_INITIALIZE_FORK_SAFETY=set:YES;srcdir=set:${CMAKE_CURRENT_SOURCE_DIR};top_srcdir=set:${CMAKE_SOURCE_DIR};top_builddir=set:${CMAKE_BINARY_DIR}")
34+
PROPERTY ENVIRONMENT_MODIFICATION "${runtime}")
3335
endforeach()
3436
endif()
3537

@@ -62,13 +64,12 @@ foreach(source_file ${source_files})
6264
)
6365
add_test(${test_executable} ${test_executable})
6466
set_tests_properties(${test_executable}
65-
PROPERTIES
66-
TIMEOUT 240)
67+
PROPERTIES TIMEOUT 240)
6768
set_tests_properties(${test_executable}
68-
PROPERTIES
69-
SKIP_RETURN_CODE 127)
69+
PROPERTIES
70+
SKIP_RETURN_CODE 127)
7071

7172
set(ENV{OBJC_DISABLE_INITIALIZE_FORK_SAFETY} "YES")
7273
set_property(TEST ${test_executable}
73-
PROPERTY ENVIRONMENT_MODIFICATION "WITH_CMAKE=set:YES;OBJC_DISABLE_INITIALIZE_FORK_SAFETY=set:YES;srcdir=set:${CMAKE_CURRENT_SOURCE_DIR};top_srcdir=set:${CMAKE_SOURCE_DIR}")
74+
PROPERTY ENVIRONMENT_MODIFICATION "${runtime}")
7475
endforeach()

0 commit comments

Comments
 (0)