summaryrefslogtreecommitdiffstats
path: root/tools/test/h5diff/CMakeTests.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test/h5diff/CMakeTests.cmake')
-rw-r--r--tools/test/h5diff/CMakeTests.cmake70
1 files changed, 51 insertions, 19 deletions
diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake
index 0f61539..d87a47f 100644
--- a/tools/test/h5diff/CMakeTests.cmake
+++ b/tools/test/h5diff/CMakeTests.cmake
@@ -366,13 +366,24 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME H5DIFF-${resultfile} COMMAND $<TARGET_FILE:h5diff> ${ARGN})
set_tests_properties (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT ${resultcode} STREQUAL "0")
+ if (NOT "${resultcode}" STREQUAL "0")
set_tests_properties (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
+ # Remove any output file left over from previous test run
+ add_test (
+ NAME H5DIFF-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ testfiles/${resultfile}.out
+ testfiles/${resultfile}.out.err
+ )
+ if (NOT "${last_test}" STREQUAL "")
+ set_tests_properties (H5DIFF-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test})
+ endif ()
add_test (
NAME H5DIFF-${resultfile}
COMMAND "${CMAKE_COMMAND}"
@@ -385,6 +396,7 @@
-D "TEST_APPEND=EXIT CODE:"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
+ set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS H5DIFF-${resultfile}-clear-objects)
endif ()
if (H5_HAVE_PARALLEL)
ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN})
@@ -396,13 +408,24 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME H5DIFF_ERR-${resultfile} COMMAND $<TARGET_FILE:h5diff> --enable-error-stack ${ARGN})
set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT ${resultcode} STREQUAL "0")
+ if (NOT "${resultcode}" STREQUAL "0")
set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
+ # Remove any output file left over from previous test run
+ add_test (
+ NAME H5DIFF_ERR-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ testfiles/${resultfile}_ERR.out
+ testfiles/${resultfile}_ERR.out.err
+ )
+ if (NOT "${last_test}" STREQUAL "")
+ set_tests_properties (H5DIFF_ERR-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test})
+ endif ()
add_test (
NAME H5DIFF_ERR-${resultfile}
COMMAND "${CMAKE_COMMAND}"
@@ -416,9 +439,7 @@
-D "TEST_APPEND=EXIT CODE:"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES DEPENDS ${last_test})
+ set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES DEPENDS H5DIFF_ERR-${resultfile}-clear-objects)
endif ()
set (last_test "H5DIFF_ERR-${resultfile}")
endmacro ()
@@ -428,13 +449,24 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (NAME PH5DIFF-${resultfile} COMMAND $<TARGET_FILE:ph5diff> ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN})
set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles")
- if (NOT ${resultcode} STREQUAL "0")
+ if (NOT "${resultcode}" STREQUAL "0")
set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
+ # Remove any output file left over from previous test run
+ add_test (
+ NAME PH5DIFF-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ PAR/testfiles/${resultfile}.out
+ PAR/testfiles/${resultfile}.out.err
+ )
+ if (NOT "${last_test}" STREQUAL "")
+ set_tests_properties (PH5DIFF-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test})
+ endif ()
add_test (
NAME PH5DIFF-${resultfile}
COMMAND "${CMAKE_COMMAND}"
@@ -450,9 +482,7 @@
-D "TEST_SORT_COMPARE=TRUE"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
+ set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS PH5DIFF-${resultfile}-clear-objects)
set (last_test "PH5DIFF-${resultfile}")
endif ()
endmacro ()
@@ -461,17 +491,17 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
# Remove any output file left over from previous test run
add_test (
- NAME H5DIFF_UD-${testname}-clearall-objects
+ NAME H5DIFF_UD-${testname}-clear-objects
COMMAND ${CMAKE_COMMAND}
-E remove
testfiles/${resultfile}.out
testfiles/${resultfile}.out.err
)
- if (${resultcode} STREQUAL "2")
+ if ("${resultcode}" STREQUAL "2")
add_test (
NAME H5DIFF_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -486,7 +516,7 @@
add_test (
NAME H5DIFF_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -498,7 +528,7 @@
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
- set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS H5DIFF_UD-${testname}-clearall-objects)
+ set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS H5DIFF_UD-${testname}-clear-objects)
endif ()
endmacro ()
@@ -512,11 +542,11 @@
testfiles/${resultfile}_ERR.out
testfiles/${resultfile}_ERR.out.err
)
- if (${resultcode} STREQUAL "2")
+ if ("${resultcode}" STREQUAL "2")
add_test (
NAME H5DIFF_UD_ERR-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
-D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}_ERR.out"
@@ -532,7 +562,7 @@
add_test (
NAME H5DIFF_UD_ERR-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
-D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}_ERR.out"
@@ -1623,8 +1653,10 @@ ADD_H5_TEST (h5diff_v3 0 -c ${FILEV1} ${FILEV2})
##############################################################################
### P L U G I N T E S T S
##############################################################################
-ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5)
-ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5)
+if (BUILD_SHARED_LIBS)
+ ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5)
+ ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5)
+endif ()
# ##############################################################################
# # END