diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-10-21 09:37:17 -0400 | 
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-10-21 09:37:17 -0400 | 
| commit | 744e47f9ce87ada87bbb5ba16170c341bab3c580 (patch) | |
| tree | b5a5dab3c04a222394b28bd4a5593c73f6cf4ed5 /tests | |
| parent | e9e6ce47c4c16abff367aedf2ee23781dd9e3554 (diff) | |
| download | stasis-744e47f9ce87ada87bbb5ba16170c341bab3c580.tar.gz | |
Rename "files" and "file_without_ext" to improve readability
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/CMakeLists.txt | 26 | 
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f4380e0..9748196 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -12,30 +12,30 @@ set(win_msvc_cflags /Wall)  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/generic.ini ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/result.xml ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/result_error.xml ${CMAKE_CURRENT_BINARY_DIR} COPYONLY) -file(GLOB files "test_*.c") +file(GLOB source_files "test_*.c")  if (BASH_PROGRAM)      add_test (rt_generic ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/rt_generic.sh)  endif() -foreach(file ${files}) -    string(REGEX REPLACE "(^.*/|\\.[^.]*$)" "" file_without_ext ${file}) -    add_executable(${file_without_ext} ${file}) +foreach(source_file ${source_files}) +    string(REGEX REPLACE "(^.*/|\\.[^.]*$)" "" test_executable ${source_file}) +    add_executable(${test_executable} ${source_file})      if (CMAKE_C_COMPILER_ID STREQUAL "GNU") -        target_compile_options(${file_without_ext} PRIVATE ${nix_cflags} ${nix_gnu_cflags}) +        target_compile_options(${test_executable} PRIVATE ${nix_cflags} ${nix_gnu_cflags})      elseif (CMAKE_C_COMPILER_ID MATCHES "Clang") -        target_compile_options(${file_without_ext} PRIVATE ${nix_cflags} ${nix_clang_cflags}) +        target_compile_options(${test_executable} PRIVATE ${nix_cflags} ${nix_clang_cflags})      elseif (CMAKE_C_COMPILER_ID STREQUAL "MSVC") -        target_compile_options(${file_without_ext} PRIVATE ${win_cflags} ${win_msvc_cflags}) +        target_compile_options(${test_executable} PRIVATE ${win_cflags} ${win_msvc_cflags})      endif() -    target_link_libraries(${file_without_ext} PRIVATE stasis_core) -    add_test(${file_without_ext} ${file_without_ext}) -    set_tests_properties(${file_without_ext} +    target_link_libraries(${test_executable} PRIVATE stasis_core) +    add_test(${test_executable} ${test_executable}) +    set_tests_properties(${test_executable}              PROPERTIES -            TIMEOUT 120) -    set_tests_properties(${file_without_ext} +            TIMEOUT 240) +    set_tests_properties(${test_executable}              PROPERTIES              SKIP_RETURN_CODE 127) -    set_property(TEST ${file_without_ext} +    set_property(TEST ${test_executable}              PROPERTY ENVIRONMENT "STASIS_SYSCONFDIR=${CMAKE_SOURCE_DIR}")  endforeach()
\ No newline at end of file  | 
