diff options
Diffstat (limited to 'tools/h5diff')
-rw-r--r-- | tools/h5diff/CMakeLists.txt | 38 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_630.txt | 3 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_631.txt | 3 | ||||
-rwxr-xr-x | tools/h5diff/testh5diff.sh | 19 |
4 files changed, 57 insertions, 6 deletions
diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index b04e577..52a58eb 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -185,6 +185,8 @@ IF (BUILD_TESTING) h5diff_627.txt h5diff_628.txt h5diff_629.txt + h5diff_630.txt + h5diff_631.txt h5diff_640.txt h5diff_641.txt h5diff_642.txt @@ -400,6 +402,35 @@ IF (BUILD_TESTING) ENDIF (HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_PH5_TEST file) + # ADD_H5_NO_OUTPUT_TEST + # Purpose to verify only exitcode without output comparison + # Don't use this if possible; this may be removed. + MACRO (ADD_H5_NO_OUTPUT_TEST testname resultcode) + # If using memchecker add tests without using scripts + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DIFF-clear-${testname}-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${testname}.out ${testname}.out.err + ) + # if there was a previous test + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DIFF-clear-${testname}-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DIFF-clear-${testname}-objects") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST (NAME H5DIFF-${testname} COMMAND $<TARGET_FILE:h5diff> ${ARGN}) + IF (NOT ${resultcode} STREQUAL "0") + SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES WILL_FAIL "true") + ENDIF (NOT ${resultcode} STREQUAL "0") + + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DIFF-${testname}") + ENDMACRO (ADD_H5_NO_OUTPUT_TEST) + ############################################################################## ############################################################################## ### T H E T E S T S ### @@ -986,6 +1017,13 @@ ADD_H5_TEST (h5diff_628 1 -n 1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) #ADD_H5_TEST (h5diff_629 2 file1.h6 file2.h6) # ############################################################################## +# # NaN +# ############################################################################## +# 6.30: test (NaN == NaN) must be true based on our documentation -- XCAO +ADD_H5_TEST (h5diff_630 0 -v -d "0.0001" ${FILE1} ${FILE1} g1/fp18 g1/fp18_COPY) +ADD_H5_TEST (h5diff_631 0 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp18 g1/fp18_COPY) + +# ############################################################################## # 7. attributes # ############################################################################## ADD_H5_TEST (h5diff_70 1 -v ${FILE5} ${FILE6}) diff --git a/tools/h5diff/testfiles/h5diff_630.txt b/tools/h5diff/testfiles/h5diff_630.txt new file mode 100644 index 0000000..aaf0148 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_630.txt @@ -0,0 +1,3 @@ +dataset: </g1/fp18> and </g1/fp18_COPY> +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_631.txt b/tools/h5diff/testfiles/h5diff_631.txt new file mode 100644 index 0000000..aaf0148 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_631.txt @@ -0,0 +1,3 @@ +dataset: </g1/fp18> and </g1/fp18_COPY> +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index fcfcc14..8d38171 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -54,7 +54,7 @@ if test -z "$srcdir"; then fi # source dirs -SRC_TOOLS="$srcdir/../" +SRC_TOOLS="$srcdir/.." SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" # testfiles source dirs for tools SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES" @@ -254,6 +254,8 @@ $SRC_H5DIFF_TESTFILES/h5diff_626.txt $SRC_H5DIFF_TESTFILES/h5diff_627.txt $SRC_H5DIFF_TESTFILES/h5diff_628.txt $SRC_H5DIFF_TESTFILES/h5diff_629.txt +$SRC_H5DIFF_TESTFILES/h5diff_630.txt +$SRC_H5DIFF_TESTFILES/h5diff_631.txt $SRC_H5DIFF_TESTFILES/h5diff_640.txt $SRC_H5DIFF_TESTFILES/h5diff_641.txt $SRC_H5DIFF_TESTFILES/h5diff_642.txt @@ -294,8 +296,10 @@ COPY_TESTFILES_TO_TESTDIR() if [ -a $tstfile ]; then $CP -f $tstfile $TESTDIR else - echo "Error: FAILED to copy $tstfile" + echo "Error: FAILED to copy $tstfile ." echo " $tstfile doesn't exist!" + + # Comment out this to CREATE expected file exit $EXIT_FAILURE fi fi @@ -629,10 +633,6 @@ TOOLTEST h5diff_609.txt -d 200 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dse # 6.10: number smaller than smallest difference TOOLTEST h5diff_610.txt -d 1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 -# 6.11: test (NaN == NaN) must be true based on our documentation -- XCAO -TOOLTEST h5diff_609.txt -d "0.0001" h5diff_basic1.h5 h5diff_basic1.h5 g1/fp18 g1/fp18_COPY -TOOLTEST h5diff_609.txt --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/fp18 g1/fp18_COPY - # ############################################################################## # # -p @@ -697,6 +697,13 @@ TOOLTEST h5diff_628.txt -n 1 h5diff_basic1.h5 h5diff_basic2.h5 g1/dset3 g1/dset4 # 6.29 non valid files #TOOLTEST h5diff_629.txt file1.h6 file2.h6 +# ############################################################################## +# # NaN +# ############################################################################## +# 6.30: test (NaN == NaN) must be true based on our documentation -- XCAO +TOOLTEST h5diff_630.txt -v -d "0.0001" h5diff_basic1.h5 h5diff_basic1.h5 g1/fp18 g1/fp18_COPY +TOOLTEST h5diff_631.txt -v --use-system-epsilon h5diff_basic1.h5 h5diff_basic1.h5 g1/fp18 g1/fp18_COPY + # ############################################################################## # 7. attributes |