summaryrefslogtreecommitdiffstats
path: root/config/cmake_ext_mod/runTest.cmake
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-12-31 18:37:58 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-12-31 18:38:09 (GMT)
commit028d47d70791ff0ec559035df80508a084e55213 (patch)
tree6d1a8afe02430252c2433ff6fd594bbaebdc3cf4 /config/cmake_ext_mod/runTest.cmake
parentfba448b1453809f8bc7bad2f5c52495191f7fbdf (diff)
downloadhdf5-028d47d70791ff0ec559035df80508a084e55213.zip
hdf5-028d47d70791ff0ec559035df80508a084e55213.tar.gz
hdf5-028d47d70791ff0ec559035df80508a084e55213.tar.bz2
Fix runtest case for data to stdout in tool
Diffstat (limited to 'config/cmake_ext_mod/runTest.cmake')
-rw-r--r--config/cmake_ext_mod/runTest.cmake11
1 files changed, 7 insertions, 4 deletions
diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake
index 8181ff0..026131b 100644
--- a/config/cmake_ext_mod/runTest.cmake
+++ b/config/cmake_ext_mod/runTest.cmake
@@ -97,10 +97,10 @@ if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
if (NOT ERROR_APPEND)
- # append error output to the stdout output file
+ # write back to original .err file
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}")
else ()
- # write back to original .err file
+ # append error output to the stdout output file
file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
endif ()
endif ()
@@ -125,8 +125,11 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}")
# remove special output
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
-string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
-file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
+string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}")
+if ("${TEST_FIND_RESULT}" GREATER "0")
+ string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
+ file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
+endif ()
# if the output file needs Storage text removed
if (TEST_MASK)