diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2024-02-15 23:49:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-15 23:49:32 (GMT) |
commit | bdddf43f1a6801e5d7c02d0d8556ee1e80047f77 (patch) | |
tree | 08c7d98a90c3cecd65ccedb536c8d81f935e8268 /config/cmake/runTest.cmake | |
parent | 7392a102d8ab67c369d2f6208bd4b23711e6ea44 (diff) | |
download | hdf5-bdddf43f1a6801e5d7c02d0d8556ee1e80047f77.zip hdf5-bdddf43f1a6801e5d7c02d0d8556ee1e80047f77.tar.gz hdf5-bdddf43f1a6801e5d7c02d0d8556ee1e80047f77.tar.bz2 |
Correct String FIND for runTest and grepTest (#4022)
Diffstat (limited to 'config/cmake/runTest.cmake')
-rw-r--r-- | config/cmake/runTest.cmake | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/config/cmake/runTest.cmake b/config/cmake/runTest.cmake index 0cfb9a3..4257c44 100644 --- a/config/cmake/runTest.cmake +++ b/config/cmake/runTest.cmake @@ -133,16 +133,18 @@ endif () message (STATUS "COMMAND Error: ${TEST_ERROR}") # remove special output -file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) -string (FIND TEST_STREAM "_pmi_alps" TEST_FIND_RESULT) -if (TEST_FIND_RESULT GREATER -1) - string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM}) -endif () -string (FIND TEST_STREAM "ulimit -s" TEST_FIND_RESULT) -if (TEST_FIND_RESULT GREATER -1) - string (REGEX REPLACE "^.*ulimit -s.*\n" "" TEST_STREAM "${TEST_STREAM}") - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM}) +if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}") + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + string (FIND "${TEST_STREAM}" "_pmi_alps" TEST_FIND_RESULT) + if (TEST_FIND_RESULT GREATER -1) + string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM}) + endif () + string (FIND "${TEST_STREAM}" "ulimit -s" TEST_FIND_RESULT) + if (TEST_FIND_RESULT GREATER -1) + string (REGEX REPLACE "^.*ulimit -s[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM}) + endif () endif () # remove special error output @@ -153,7 +155,7 @@ else () # the error stack remains in the .err file file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) endif () -string (FIND TEST_STREAM "no version information available" TEST_FIND_RESULT) +string (FIND "${TEST_STREAM}" "no version information available" TEST_FIND_RESULT) if (TEST_FIND_RESULT GREATER -1) string (REGEX REPLACE "^.*no version information available[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") # write back the changes to the original files |