summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-02-15 21:48:24 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-02-15 21:48:24 (GMT)
commit122b63a5a27227f2349634f4e8f8e43d739255f5 (patch)
tree195fb47964dd6c95844ad1ec4da210bdaa0b9c25 /test
parent6ea0dafa41415c0888889214c82f75a02ec4a545 (diff)
downloadhdf5-122b63a5a27227f2349634f4e8f8e43d739255f5.zip
hdf5-122b63a5a27227f2349634f4e8f8e43d739255f5.tar.gz
hdf5-122b63a5a27227f2349634f4e8f8e43d739255f5.tar.bz2
HDFFV-10703 Update CMake commands to latest standard
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt20
-rw-r--r--test/CMakeTests.cmake40
-rw-r--r--test/CMakeVFDTests.cmake20
-rw-r--r--test/CMakeVOLTests.cmake14
-rw-r--r--test/flushrefreshTest.cmake102
5 files changed, 98 insertions, 98 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 0d67485..c442e9b 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -293,9 +293,9 @@ set (H5_TESTS_MULTIPLE
ttsafe
)
# Only build single source tests here
-foreach (test ${H5_TESTS})
- if (NOT ${test} IN_LIST H5_TESTS_MULTIPLE)
- ADD_H5_EXE(${test})
+foreach (h5_test ${H5_TESTS})
+ if (NOT h5_test IN_LIST H5_TESTS_MULTIPLE)
+ ADD_H5_EXE(${h5_test})
endif ()
endforeach ()
@@ -378,15 +378,15 @@ set (H5_CHECK_TESTS
flushrefresh
)
-foreach (test ${H5_CHECK_TESTS})
- ADD_H5_EXE(${test})
+foreach (h5_test ${H5_CHECK_TESTS})
+ ADD_H5_EXE(${h5_test})
endforeach ()
#-- Adding test for libinfo
set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake)
file (WRITE ${GREP_RUNNER}
"file (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\")
-if (\${TEST_RESULT} STREQUAL \"0\")
+if (NOT TEST_RESULT)
message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\")
else ()
message (STATUS \"COMMAND Result: \${TEST_RESULT}\")
@@ -411,8 +411,8 @@ set (H5_SWMR_TESTS
swmr_writer
)
-foreach (test ${H5_SWMR_TESTS})
- ADD_H5_EXE(${test})
+foreach (h5_test ${H5_SWMR_TESTS})
+ ADD_H5_EXE(${h5_test})
endforeach ()
set (H5_VDS_SWMR_TESTS
@@ -421,8 +421,8 @@ set (H5_VDS_SWMR_TESTS
vds_swmr_writer
)
-foreach (test ${H5_VDS_SWMR_TESTS})
- ADD_H5_EXE(${test})
+foreach (h5_test ${H5_VDS_SWMR_TESTS})
+ ADD_H5_EXE(${h5_test})
endforeach ()
#-- Adding test for accum_swmr_reader
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index 959e537..26e5a78 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -545,33 +545,33 @@ set (H5TEST_SEPARATE_TESTS
flush1
flush2
)
-foreach (test ${H5_TESTS})
- if (NOT ${test} IN_LIST H5TEST_SEPARATE_TESTS)
+foreach (h5_test ${H5_TESTS})
+ if (NOT h5_test IN_LIST H5TEST_SEPARATE_TESTS)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5TEST-${test} COMMAND $<TARGET_FILE:${test}>)
- set_tests_properties (H5TEST-${test} PROPERTIES
+ add_test (NAME H5TEST-${h5_test} COMMAND $<TARGET_FILE:${h5_test}>)
+ set_tests_properties (H5TEST-${h5_test} PROPERTIES
FIXTURES_REQUIRED clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
else ()
- if ("${test}" STREQUAL "big" AND CYGWIN)
- add_test (NAME H5TEST-${test}
+ if (h5_test STREQUAL "big" AND CYGWIN)
+ add_test (NAME H5TEST-${h5_test}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}"
)
else ()
- add_test (NAME H5TEST-${test} COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${test}>"
+ add_test (NAME H5TEST-${h5_test} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:${h5_test}>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
-D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=${test}.txt"
+ -D "TEST_OUTPUT=${h5_test}.txt"
#-D "TEST_REFERENCE=${test}.out"
-D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
- set_tests_properties (H5TEST-${test} PROPERTIES
+ set_tests_properties (H5TEST-${h5_test} PROPERTIES
FIXTURES_REQUIRED clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
@@ -596,25 +596,25 @@ if (BUILD_SHARED_LIBS)
)
set_tests_properties (H5TEST-shared-clear-objects PROPERTIES FIXTURES_SETUP shared_clear_objects)
- foreach (test ${H5_TESTS})
- if (NOT ${test} IN_LIST H5TEST_SEPARATE_TESTS)
- if ("${test}" STREQUAL "big" AND CYGWIN)
- add_test (NAME H5TEST-shared-${test}
+ foreach (h5_test ${H5_TESTS})
+ if (NOT h5_test IN_LIST H5TEST_SEPARATE_TESTS)
+ if (h5_test STREQUAL "big" AND CYGWIN)
+ add_test (NAME H5TEST-shared-${h5_test}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared"
)
else ()
- add_test (NAME H5TEST-shared-${test} COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${test}-shared>"
+ add_test (NAME H5TEST-shared-${h5_test} COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:${h5_test}-shared>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
-D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=${test}.txt"
+ -D "TEST_OUTPUT=${h5_test}.txt"
#-D "TEST_REFERENCE=${test}.out"
-D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
- set_tests_properties (H5TEST-shared-${test} PROPERTIES
+ set_tests_properties (H5TEST-shared-${h5_test} PROPERTIES
FIXTURES_REQUIRED shared_clear_objects
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
@@ -1193,8 +1193,8 @@ if (HDF5_BUILD_GENERATORS)
gen_plist
)
- foreach (gen ${H5_GENERATORS})
- ADD_H5_GENERATOR (${gen})
+ foreach (h5_gen ${H5_GENERATORS})
+ ADD_H5_GENERATOR (${h5_gen})
endforeach ()
endif ()
diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake
index 569f215..ad3d1e9 100644
--- a/test/CMakeVFDTests.cmake
+++ b/test/CMakeVFDTests.cmake
@@ -109,9 +109,9 @@ endif ()
# Windows only macro
macro (CHECK_VFD_TEST vfdtest vfdname resultcode)
- if ("${vfdtest}" STREQUAL "flush1" OR "${vfdtest}" STREQUAL "flush2")
- if ("${vfdname}" STREQUAL "multi" OR "${vfdname}" STREQUAL "split")
- if (NOT BUILD_SHARED_LIBS AND NOT ${HDF_CFG_NAME} MATCHES "Debug")
+ if (vfdtest STREQUAL "flush1" OR vfdtest STREQUAL "flush2")
+ if (vfdname STREQUAL "multi" OR vfdname STREQUAL "split")
+ if (NOT BUILD_SHARED_LIBS AND NOT HDF_CFG_NAME MATCHES "Debug")
add_test (
NAME VFD-${vfdname}-${vfdtest}-clear-objects
COMMAND ${CMAKE_COMMAND}
@@ -239,7 +239,7 @@ endif ()
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
)
- if (BUILD_SHARED_LIBS AND NOT "${vfdtest}" STREQUAL "cache")
+ if (BUILD_SHARED_LIBS AND NOT vfdtest STREQUAL "cache")
add_test (
NAME VFD-${vfdname}-${vfdtest}-shared-clear-objects
COMMAND ${CMAKE_COMMAND}
@@ -316,12 +316,12 @@ endif ()
endmacro ()
macro (ADD_VFD_TEST vfdname resultcode)
- foreach (test ${H5_TESTS})
- if (NOT ${test} IN_LIST H5_VFD_SKIP_TESTS)
+ foreach (h5_test ${H5_TESTS})
+ if (NOT h5_test IN_LIST H5_VFD_SKIP_TESTS)
if (WIN32)
- CHECK_VFD_TEST (${test} ${vfdname} ${resultcode})
+ CHECK_VFD_TEST (${h5_test} ${vfdname} ${resultcode})
else ()
- DO_VFD_TEST (${test} ${vfdname} ${resultcode})
+ DO_VFD_TEST (${h5_test} ${vfdname} ${resultcode})
endif ()
endif ()
endforeach ()
@@ -394,6 +394,6 @@ endif ()
endmacro ()
# Run test with different Virtual File Driver
- foreach (vfd ${VFD_LIST})
- ADD_VFD_TEST (${vfd} 0)
+ foreach (h5_vfd ${VFD_LIST})
+ ADD_VFD_TEST (${h5_vfd} 0)
endforeach ()
diff --git a/test/CMakeVOLTests.cmake b/test/CMakeVOLTests.cmake
index 334520c..7c02e23 100644
--- a/test/CMakeVOLTests.cmake
+++ b/test/CMakeVOLTests.cmake
@@ -106,8 +106,8 @@ endif ()
# Windows only macro
macro (CHECK_VOL_TEST voltest volname volinfo resultcode)
- if ("${voltest}" STREQUAL "flush1" OR "${voltest}" STREQUAL "flush2")
- if ("${volname}" STREQUAL "multi" OR "${volname}" STREQUAL "split")
+ if (voltest STREQUAL "flush1" OR voltest STREQUAL "flush2")
+ if (volname STREQUAL "multi" OR volname STREQUAL "split")
if (NOT BUILD_SHARED_LIBS AND NOT ${HDF_CFG_NAME} MATCHES "Debug")
add_test (
NAME VOL-${volname}-${voltest}-clear-objects
@@ -236,7 +236,7 @@ endif ()
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname};HDF5TestExpress=${HDF_TEST_EXPRESS}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname}
)
- if (BUILD_SHARED_LIBS AND NOT "${voltest}" STREQUAL "cache")
+ if (BUILD_SHARED_LIBS AND NOT voltest STREQUAL "cache")
add_test (
NAME VOL-${volname}-${voltest}-shared-clear-objects
COMMAND ${CMAKE_COMMAND}
@@ -315,12 +315,12 @@ endif ()
macro (ADD_VOL_TEST volname volinfo resultcode)
#message(STATUS "volname=${volname} volinfo=${volinfo}")
- foreach (test ${H5_TESTS})
- if (NOT ${test} IN_LIST H5_VOL_SKIP_TESTS)
+ foreach (h5_test ${H5_TESTS})
+ if (NOT h5_test IN_LIST H5_VOL_SKIP_TESTS)
if (WIN32)
- CHECK_VOL_TEST (${test} ${volname} "${volinfo}" ${resultcode})
+ CHECK_VOL_TEST (${h5_test} ${volname} "${volinfo}" ${resultcode})
else ()
- DO_VOL_TEST (${test} ${volname} "${volinfo}" ${resultcode})
+ DO_VOL_TEST (${h5_test} ${volname} "${volinfo}" ${resultcode})
endif ()
endif ()
endforeach ()
diff --git a/test/flushrefreshTest.cmake b/test/flushrefreshTest.cmake
index f66ee64..aa18c8a 100644
--- a/test/flushrefreshTest.cmake
+++ b/test/flushrefreshTest.cmake
@@ -53,7 +53,7 @@ if (TEST_ENV_VAR)
#message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}")
endif ()
-message(STATUS "Background: ${PERL_EXECUTABLE} ${PERL_SCRIPT} ${TEST_PROGRAM}")
+message (STATUS "Background: ${PERL_EXECUTABLE} ${PERL_SCRIPT} ${TEST_PROGRAM}")
execute_process (
COMMAND ${PERL_EXECUTABLE} ${PERL_SCRIPT} ${TEST_PROGRAM}
RESULT_VARIABLE SCRIPT_RESULT
@@ -61,34 +61,34 @@ execute_process (
OUTPUT_VARIABLE SCRIPT_OUTPUT
WORKING_DIRECTORY ${TEST_FOLDER}
)
-message(STATUS "Background: ${SCRIPT_OUTPUT}")
-if (NOT "${SCRIPT_RESULT}" STREQUAL "0")
+message (STATUS "Background: ${SCRIPT_OUTPUT}")
+if (SCRIPT_RESULT)
message (FATAL_ERROR "Failed: The background script failed ${SCRIPT_RESULT}: ${SCRIPT_ERR}")
endif ()
-set(verification_done "0")
-while(verification_done LESS "1")
- message(STATUS "checking first stage:${TEST_FOLDER}/${TEST_ARGS1}")
- if(EXISTS ${TEST_FOLDER}/${TEST_ERR})
+set (verification_done "0")
+while (verification_done LESS "1")
+ message (STATUS "checking first stage:${TEST_FOLDER}/${TEST_ARGS1}")
+ if (EXISTS ${TEST_FOLDER}/${TEST_ERR})
# Error exit script
- set(verification_done "3")
- elseif(EXISTS ${TEST_FOLDER}/${TEST_ARGS1})
+ set (verification_done "3")
+ elseif (EXISTS ${TEST_FOLDER}/${TEST_ARGS1})
file (STRINGS ${TEST_FOLDER}/${TEST_ARGS1} v1)
list (LENGTH v1 len_v1)
- message(STATUS "v1:${v1} len_v1:${len_v1}")
- if (NOT "${len_v1}" STREQUAL "0")
+ message (STATUS "v1:${v1} len_v1:${len_v1}")
+ if (len_v1)
list (GET v1 0 param1)
list (GET v1 -1 param2)
endif ()
- file(REMOVE ${TEST_FOLDER}/${TEST_ARGS1})
- message(STATUS "PARAM1:${param1} PARAM2:${param2}")
+ file (REMOVE ${TEST_FOLDER}/${TEST_ARGS1})
+ message (STATUS "PARAM1:${param1} PARAM2:${param2}")
- if(${param1} MATCHES "VERIFICATION_DONE")
- set(verification_done "1")
- file(WRITE ${TEST_FOLDER}/${TEST_ARGS2} "all flush verification complete")
- message(STATUS "write: ${TEST_FOLDER}/${TEST_ARGS2}")
- else()
- message(STATUS "execute: ${TEST_PROGRAM} ${param1} ${param2}")
+ if (param1 MATCHES "VERIFICATION_DONE")
+ set (verification_done "1")
+ file (WRITE ${TEST_FOLDER}/${TEST_ARGS2} "all flush verification complete")
+ message (STATUS "write: ${TEST_FOLDER}/${TEST_ARGS2}")
+ else ()
+ message (STATUS "execute: ${TEST_PROGRAM} ${param1} ${param2}")
execute_process (
COMMAND ${TEST_PROGRAM} ${param1} ${param2}
RESULT_VARIABLE TEST_RESULT
@@ -98,40 +98,40 @@ while(verification_done LESS "1")
ERROR_VARIABLE TEST_ERROR
WORKING_DIRECTORY ${TEST_FOLDER}
)
- message(STATUS "flush verification: ${TEST_OUT}")
- if (NOT "${TEST_RESULT}" STREQUAL "0")
+ message (STATUS "flush verification: ${TEST_OUT}")
+ if (TEST_RESULT)
message (FATAL_ERROR "Failed: The flush verification failed ${TEST_RESULT}: ${TEST_ERROR}")
endif ()
- file(WRITE ${TEST_FOLDER}/${TEST_ARGS2} "verification flush process done")
- endif()
- else()
- message(STATUS "waiting: ${TEST_FOLDER}/${TEST_ARGS1}")
+ file (WRITE ${TEST_FOLDER}/${TEST_ARGS2} "verification flush process done")
+ endif ()
+ else ()
+ message (STATUS "waiting: ${TEST_FOLDER}/${TEST_ARGS1}")
#execute_process (COMMAND ${CMAKE_COMMAND} -E sleep 2)
- endif()
-endwhile()
+ endif ()
+endwhile ()
-while(verification_done LESS "2")
- message(STATUS "checking second stage:${TEST_FOLDER}/${TEST_ARGS1}")
- if(EXISTS ${TEST_FOLDER}/${TEST_ERR})
+while (verification_done LESS "2")
+ message (STATUS "checking second stage:${TEST_FOLDER}/${TEST_ARGS1}")
+ if (EXISTS ${TEST_FOLDER}/${TEST_ERR})
# Error exit script
- set(verification_done "3")
- elseif(EXISTS ${TEST_FOLDER}/${TEST_ARGS1})
+ set (verification_done "3")
+ elseif (EXISTS ${TEST_FOLDER}/${TEST_ARGS1})
file (STRINGS ${TEST_FOLDER}/${TEST_ARGS1} v1)
list (LENGTH v1 len_v1)
- message(STATUS "v1:${v1} len_v1:${len_v1}")
- if (NOT "${len_v1}" STREQUAL "0")
+ message (STATUS "v1:${v1} len_v1:${len_v1}")
+ if (len_v1)
list (GET v1 0 param1)
list (GET v1 -1 param2)
endif ()
- file(REMOVE ${TEST_FOLDER}/${TEST_ARGS1})
- message(STATUS "PARAM1:${param1} PARAM2:${param2}")
+ file (REMOVE ${TEST_FOLDER}/${TEST_ARGS1})
+ message (STATUS "PARAM1:${param1} PARAM2:${param2}")
- if(${param1} MATCHES "VERIFICATION_DONE")
- set(verification_done "2")
- file(WRITE ${TEST_FOLDER}/${TEST_ARGS2} "all refresh verification complete")
- message(STATUS "write: ${TEST_FOLDER}/${TEST_ARGS2}")
- else()
- message(STATUS "execute: ${TEST_PROGRAM} ${param1}")
+ if (param1 MATCHES "VERIFICATION_DONE")
+ set (verification_done "2")
+ file (WRITE ${TEST_FOLDER}/${TEST_ARGS2} "all refresh verification complete")
+ message (STATUS "write: ${TEST_FOLDER}/${TEST_ARGS2}")
+ else ()
+ message (STATUS "execute: ${TEST_PROGRAM} ${param1}")
execute_process (
COMMAND ${TEST_PROGRAM} ${param1}
RESULT_VARIABLE TEST_RESULT
@@ -141,22 +141,22 @@ while(verification_done LESS "2")
ERROR_VARIABLE TEST_ERROR
WORKING_DIRECTORY ${TEST_FOLDER}
)
- message(STATUS "refresh verification: ${TEST_OUT}")
- if (NOT "${TEST_RESULT}" STREQUAL "0")
+ message (STATUS "refresh verification: ${TEST_OUT}")
+ if (TEST_RESULT)
message (FATAL_ERROR "Failed: The refresh verification failed ${TEST_RESULT}: ${TEST_ERROR}")
endif ()
- file(WRITE ${TEST_FOLDER}/${TEST_ARGS2} "refresh verifiction process done")
- endif()
- else()
- message(STATUS "waiting: ${TEST_FOLDER}/${TEST_ARGS1}")
+ file (WRITE ${TEST_FOLDER}/${TEST_ARGS2} "refresh verifiction process done")
+ endif ()
+ else ()
+ message (STATUS "waiting: ${TEST_FOLDER}/${TEST_ARGS1}")
#execute_process (COMMAND ${CMAKE_COMMAND} -E sleep 2)
- endif()
-endwhile()
+ endif ()
+endwhile ()
message (STATUS "COMMAND Result: ${TEST_RESULT}")
# if the return value is !=${TEST_EXPECT} bail out
-if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}")
+if (NOT TEST_RESULT EQUAL TEST_EXPECT)
if (NOT TEST_NOERRDISPLAY)
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)