summaryrefslogtreecommitdiffstats
path: root/config/cmake/jrunTest.cmake
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-10-02 17:39:15 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-10-02 17:39:15 (GMT)
commit4f9e47650aa98d1048da87be44ff3d28685554b7 (patch)
tree80bd1e918a76f086e8aef5cb3d5034f2d94d41cc /config/cmake/jrunTest.cmake
parent19ee2f9dc8ce4352b3ec82c667abecb47a1d9684 (diff)
downloadhdf5-4f9e47650aa98d1048da87be44ff3d28685554b7.zip
hdf5-4f9e47650aa98d1048da87be44ff3d28685554b7.tar.gz
hdf5-4f9e47650aa98d1048da87be44ff3d28685554b7.tar.bz2
Fix STREQUAL if commands.
Diffstat (limited to 'config/cmake/jrunTest.cmake')
-rw-r--r--config/cmake/jrunTest.cmake30
1 files changed, 15 insertions, 15 deletions
diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake
index 7af0590..b66f3a8 100644
--- a/config/cmake/jrunTest.cmake
+++ b/config/cmake/jrunTest.cmake
@@ -122,7 +122,7 @@ if (TEST_MASK_ERROR)
endif ()
# if the return value is !=0 bail out
-if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT})
+if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}")
message (STATUS "ERROR OUTPUT: ${TEST_STREAM}")
message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != 0.\n${TEST_ERROR}")
endif ()
@@ -141,13 +141,13 @@ if (NOT TEST_SKIP_COMPARE)
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
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} 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)
@@ -160,14 +160,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 ()
@@ -175,7 +175,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 ()
@@ -191,14 +191,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)
@@ -211,14 +211,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 ()
@@ -239,15 +239,15 @@ if (TEST_GREP_COMPARE)
# TEST_REFERENCE should always be matched
string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
- if (${TEST_RESULT} STREQUAL "0")
+ if ("${TEST_RESULT}" STREQUAL "0")
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
endif ()
string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
- if (${TEST_EXPECT} STREQUAL "1")
+ if ("${TEST_EXPECT}" STREQUAL "1")
# TEST_EXPECT (1) interperts TEST_FILTER as NOT to match
string (LENGTH "${TEST_MATCH}" TEST_RESULT)
- if (NOT ${TEST_RESULT} STREQUAL "0")
+ if (NOT "${TEST_RESULT}" STREQUAL "0")
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
endif ()
endif ()