summaryrefslogtreecommitdiffstats
path: root/tools/test/h5dump/CMakeTests.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test/h5dump/CMakeTests.cmake')
-rw-r--r--tools/test/h5dump/CMakeTests.cmake89
1 files changed, 74 insertions, 15 deletions
diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake
index d3d1c4d..cdd3e6d 100644
--- a/tools/test/h5dump/CMakeTests.cmake
+++ b/tools/test/h5dump/CMakeTests.cmake
@@ -407,8 +407,19 @@
endif ()
set (last_test "H5DUMP-${testname}")
else ()
+ # Remove any output file left over from previous test run
+ add_test (
+ NAME H5DUMP-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ testfiles/std/h5dump-${testname}.out
+ testfiles/std/h5dump-${testname}.out.err
+ )
+ if (NOT "${last_test}" STREQUAL "")
+ set_tests_properties (H5DUMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
+ endif ()
add_test (
- NAME H5DUMP-h5dump-${testname}
+ NAME H5DUMP-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
-D "TEST_ARGS:STRING=${ARGN}"
@@ -418,11 +429,12 @@
-D "TEST_REFERENCE=h5dump-${testname}.txt"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
+ set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS H5DUMP-${testname}-clear-objects)
endif ()
endmacro ()
macro (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype)
- if (${testtype} STREQUAL "SKIP")
+ if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5DUMP-${skipresultfile}-SKIPPED
@@ -439,7 +451,7 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- if (NOT ${resultcode} STREQUAL "0")
+ if (NOT "${resultcode}" STREQUAL "0")
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
if (NOT "${last_test}" STREQUAL "")
@@ -449,7 +461,10 @@
add_test (
NAME H5DUMP-${resultfile}-clear-objects
COMMAND ${CMAKE_COMMAND}
- -E remove ${resultfile}.bin
+ -E remove
+ ${resultfile}.bin
+ ${resultfile}.out
+ ${resultfile}.out.err
)
set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
@@ -472,7 +487,7 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME H5DUMP-N-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN})
set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- if (NOT ${resultcode} STREQUAL "0")
+ if (NOT "${resultcode}" STREQUAL "0")
set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
if (NOT "${last_test}" STREQUAL "")
@@ -482,7 +497,10 @@
add_test (
NAME H5DUMP-N-${resultfile}-clear-objects
COMMAND ${CMAKE_COMMAND}
- -E remove ${resultfile}-N.bin
+ -E remove
+ ${resultfile}-N.bin
+ ${resultfile}-N.out
+ ${resultfile}-N.out.err
)
set_tests_properties (H5DUMP-N-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
@@ -505,7 +523,7 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN} ${resultfile}.txt ${targetfile})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- if (NOT ${resultcode} STREQUAL "0")
+ if (NOT "${resultcode}" STREQUAL "0")
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
if (NOT "${last_test}" STREQUAL "")
@@ -515,7 +533,10 @@
add_test (
NAME H5DUMP-${resultfile}-clear-objects
COMMAND ${CMAKE_COMMAND}
- -E remove ${resultfile}.txt
+ -E remove
+ ${resultfile}.txt
+ ${resultfile}.out
+ ${resultfile}.out.err
)
set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
@@ -545,7 +566,7 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- if (NOT ${resultcode} STREQUAL "0")
+ if (NOT "${resultcode}" STREQUAL "0")
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
if (NOT "${last_test}" STREQUAL "")
@@ -555,7 +576,11 @@
add_test (
NAME H5DUMP-${resultfile}-clear-objects
COMMAND ${CMAKE_COMMAND}
- -E remove ${ddlfile}.txt ${resultfile}.txt
+ -E remove
+ ${ddlfile}.txt
+ ${resultfile}.txt
+ ${resultfile}.out
+ ${resultfile}.out.err
)
set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
@@ -613,6 +638,15 @@
macro (ADD_H5_MASK_TEST resultfile resultcode)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ # Remove any output file left over from previous test run
+ add_test (
+ NAME H5DUMP-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ${resultfile}.out
+ ${resultfile}.out.err
+ )
+ set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
@@ -625,11 +659,21 @@
-D "TEST_MASK_ERROR=true"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
+ set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
endif ()
endmacro ()
macro (ADD_H5ERR_MASK_TEST resultfile resultcode)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ # Remove any output file left over from previous test run
+ add_test (
+ NAME H5DUMP-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ${resultfile}.out
+ ${resultfile}.out.err
+ )
+ set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
@@ -643,11 +687,21 @@
-D "TEST_MASK_ERROR=true"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
+ set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
endif ()
endmacro ()
macro (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ # Remove any output file left over from previous test run
+ add_test (
+ NAME H5DUMP-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ${resultfile}.out
+ ${resultfile}.out.err
+ )
+ set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
@@ -663,6 +717,7 @@
-D "TEST_ENV_VALUE:STRING=${envval}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
+ set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
endif ()
endmacro ()
@@ -672,7 +727,10 @@
add_test (
NAME H5DUMP-IMPORT-${resultfile}-clear-objects
COMMAND ${CMAKE_COMMAND}
- -E remove ${resultfile}.bin ${resultfile}.h5
+ -E remove
+ ${resultfile}.bin
+ ${resultfile}.h5
+ ${conffile}.out
)
set_tests_properties (H5DUMP-IMPORT-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
@@ -700,12 +758,13 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
# Remove any output file left over from previous test run
add_test (
- NAME H5DUMP_UD-${testname}-clearall-objects
+ NAME H5DUMP_UD-${testname}-clear-objects
COMMAND ${CMAKE_COMMAND}
-E remove
- testfiles/std/${resultfile}.out
- testfiles/std/${resultfile}.out.err
+ ${resultfile}.out
+ ${resultfile}.out.err
)
+ set_tests_properties (H5DUMP_UD-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
NAME H5DUMP_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
@@ -719,7 +778,7 @@
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP_UD-${testname} PROPERTIES DEPENDS H5DUMP_UD-${testname}-clearall-objects)
+ set_tests_properties (H5DUMP_UD-${testname} PROPERTIES DEPENDS H5DUMP_UD-${testname}-clear-objects)
endif ()
endmacro ()