summaryrefslogtreecommitdiffstats
path: root/config/cmake_ext_mod/runTest.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'config/cmake_ext_mod/runTest.cmake')
-rw-r--r--config/cmake_ext_mod/runTest.cmake30
1 files changed, 15 insertions, 15 deletions
diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake
index 0a9ebd1..2479728 100644
--- a/config/cmake_ext_mod/runTest.cmake
+++ b/config/cmake_ext_mod/runTest.cmake
@@ -8,7 +8,7 @@
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
-
+#
# runTest.cmake executes a command and captures the output in a file. File is then compared
# against a reference file. Exit status of command can also be compared.
cmake_policy(SET CMP0007 NEW)
@@ -87,7 +87,7 @@ if (TEST_REGEX)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM})
string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT)
- if (${REGEX_RESULT} STREQUAL "0")
+ if ("${REGEX_RESULT}" STREQUAL "0")
message (STATUS "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}")
endif ()
endif ()
@@ -106,7 +106,7 @@ if (TEST_APPEND)
endif ()
# if the return value is !=${TEST_EXPECT} bail out
-if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT})
+if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}")
if (NOT TEST_NOERRDISPLAY)
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
@@ -193,13 +193,13 @@ if (NOT TEST_SKIP_COMPARE)
endif ()
endif ()
- if (NOT ${TEST_RESULT} STREQUAL 0)
+ if (NOT "${TEST_RESULT}" STREQUAL "0")
set (TEST_RESULT 0)
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
list (LENGTH test_act len_act)
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
list (LENGTH test_ref len_ref)
- if (NOT ${len_act} STREQUAL "0" AND NOT ${len_ref} STREQUAL "0")
+ if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0")
math (EXPR _FP_LEN "${len_ref} - 1")
foreach (line RANGE 0 ${_FP_LEN})
list (GET test_act ${line} str_act)
@@ -212,14 +212,14 @@ if (NOT TEST_SKIP_COMPARE)
endif ()
endforeach ()
else ()
- if (${len_act} STREQUAL "0")
+ if ("${len_act}" STREQUAL "0")
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
endif ()
- if (${len_ref} STREQUAL "0")
+ if ("${len_ref}" STREQUAL "0")
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
endif ()
endif ()
- if (NOT ${len_act} STREQUAL ${len_ref})
+ if (NOT "${len_act}" STREQUAL "${len_ref}")
set (TEST_RESULT 1)
endif ()
endif ()
@@ -227,7 +227,7 @@ if (NOT TEST_SKIP_COMPARE)
message (STATUS "COMPARE Result: ${TEST_RESULT}")
# again, if return value is !=0 scream and shout
- if (NOT ${TEST_RESULT} STREQUAL 0)
+ if (NOT "${TEST_RESULT}" STREQUAL "0")
message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
endif ()
@@ -243,14 +243,14 @@ if (NOT TEST_SKIP_COMPARE)
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF}
RESULT_VARIABLE TEST_RESULT
)
- if (NOT ${TEST_RESULT} STREQUAL 0)
+ if (NOT "${TEST_RESULT}" STREQUAL "0")
set (TEST_RESULT 0)
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
list (LENGTH test_act len_act)
file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
list (LENGTH test_ref len_ref)
math (EXPR _FP_LEN "${len_ref} - 1")
- if (NOT ${len_act} STREQUAL "0" AND NOT ${len_ref} STREQUAL "0")
+ if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0")
math (EXPR _FP_LEN "${len_ref} - 1")
foreach (line RANGE 0 ${_FP_LEN})
list (GET test_act ${line} str_act)
@@ -263,14 +263,14 @@ if (NOT TEST_SKIP_COMPARE)
endif ()
endforeach ()
else ()
- if (${len_act} STREQUAL "0")
+ if ("${len_act}" STREQUAL "0")
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty")
endif ()
- if (${len_ref} STREQUAL "0")
+ if ("${len_ref}" STREQUAL "0")
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty")
endif ()
endif ()
- if (NOT ${len_act} STREQUAL ${len_ref})
+ if (NOT "${len_act}" STREQUAL "${len_ref}")
set (TEST_RESULT 1)
endif ()
endif ()
@@ -278,7 +278,7 @@ if (NOT TEST_SKIP_COMPARE)
message (STATUS "COMPARE Result: ${TEST_RESULT}")
# again, if return value is !=0 scream and shout
- if (NOT ${TEST_RESULT} STREQUAL 0)
+ if (NOT "${TEST_RESULT}" STREQUAL "0")
message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}")
endif ()
endif ()