Skip to content

Commit d3c2cf2

Browse files
committed
Adding a workaround for older versions of cmake that are still common in the wild, rather than force manual upgrades.
1 parent feaa6cd commit d3c2cf2

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2205,7 +2205,7 @@ MACRO(print_conf_summary)
22052205

22062206
MESSAGE("")
22072207
ENDMACRO()
2208-
##
2208+
##specific
22092209
# Shell script Macro
22102210
##
22112211
# Determine if 'bash' is on the system.
@@ -2232,7 +2232,7 @@ ENDIF(ENABLE_BASH_SCRIPT_TESTING)
22322232

22332233
MACRO(add_sh_test prefix F)
22342234
IF(HAVE_BASH)
2235-
ADD_TEST(${prefix}_${F} bash "-c" "export srcdir=${CMAKE_CURRENT_SOURCE_DIR};export TOPSRCDIR=${CMAKE_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}/${F}.sh ${ARGN}")
2235+
ADD_TEST(${prefix}_${F} bash "-c" "export srcdir=${CMAKE_CURRENT_SOURCE_DIR};export TOPSRCDIR=${CMAKE_SOURCE_DIR};bash ${CMAKE_CURRENT_BINARY_DIR}/${F}.sh ${ARGN}")
22362236
ENDIF()
22372237
ENDMACRO()
22382238

nczarr_test/CMakeLists.txt

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ FILE(READ ${CMAKE_CURRENT_SOURCE_DIR}/../nc_test4/tst_specific_filters.sh SPSOUR
2121
STRING(PREPEND SPSOURCE "#!/bin/bash\n")
2222
STRING(PREPEND SPSOURCE "TESTNCZARR=1\n")
2323
# Replace with FILE(CONFIGURE) when cmake 3.18 is in common use
24+
2425
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/run_specific_filters.1 "${SPSOURCE}")
2526
CONFIGURE_FILE(${CMAKE_CURRENT_BINARY_DIR}/run_specific_filters.1 ${CMAKE_CURRENT_BINARY_DIR}/run_specific_filters.sh FILE_PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE @ONLY NEWLINE_STYLE LF)
27+
2628
FILE(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/run_specific_filters.1)
2729

2830
FILE(READ ${CMAKE_CURRENT_SOURCE_DIR}/../nc_test4/tst_unknown.sh SPSOURCE)
@@ -130,26 +132,26 @@ IF(ENABLE_TESTS)
130132
add_sh_test(nczarr_test run_s3_cleanup)
131133
ENDIF()
132134

133-
IF(ENABLE_FILTER_TESTING)
134-
build_bin_test(tst_nczfilter)
135-
build_bin_test(testfilter)
136-
build_bin_test(testfilter_misc)
137-
build_bin_test(testfilter_multi)
138-
build_bin_test(testfilter_order)
139-
build_bin_test(testfilter_repeat)
140-
build_bin_test(test_filter_avail)
141-
ADD_SH_TEST(nczarr_test run_nczfilter)
142-
ADD_SH_TEST(nczarr_test run_filter)
143-
ADD_SH_TEST(nczarr_test run_specific_filters)
144-
IF(FALSE)
135+
IF(ENABLE_FILTER_TESTING)
136+
build_bin_test(tst_nczfilter)
137+
build_bin_test(testfilter)
138+
build_bin_test(testfilter_misc)
139+
build_bin_test(testfilter_multi)
140+
build_bin_test(testfilter_order)
141+
build_bin_test(testfilter_repeat)
142+
build_bin_test(test_filter_avail)
143+
ADD_SH_TEST(nczarr_test run_nczfilter)
144+
ADD_SH_TEST(nczarr_test run_filter)
145+
ADD_SH_TEST(nczarr_test run_specific_filters)
146+
IF(FALSE)
145147
# This test is too dangerous to run in a parallel make environment.
146-
# It causes race conditions. So suppress and only test by hand.
147-
ADD_SH_TEST(nczarr_test run_unknown)
148-
ENDIF(FALSE)
149-
ENDIF(ENABLE_FILTER_TESTING)
150-
if(ENABLE_NCZARR_ZIP)
151-
add_sh_test(nczarr_test run_newformat)
152-
endif()
148+
# It causes race conditions. So suppress and only test by hand.
149+
ADD_SH_TEST(nczarr_test run_unknown)
150+
ENDIF(FALSE)
151+
ENDIF(ENABLE_FILTER_TESTING)
152+
if(ENABLE_NCZARR_ZIP)
153+
add_sh_test(nczarr_test run_newformat)
154+
endif()
153155

154156
ENDIF(BUILD_UTILITIES)
155157

0 commit comments

Comments
 (0)