diff options
author | Jonathan Kim <jkm@hdfgroup.org> | 2011-08-17 16:06:32 (GMT) |
---|---|---|
committer | Jonathan Kim <jkm@hdfgroup.org> | 2011-08-17 16:06:32 (GMT) |
commit | caad58c541fcbcec522d784b13100860b1d32f7a (patch) | |
tree | 9a0b275dbe05fe84a86adf01dd5efa46b9dd784c /tools | |
parent | c6e1f166e32ae39eb18484749e47293278eaa115 (diff) | |
download | hdf5-caad58c541fcbcec522d784b13100860b1d32f7a.zip hdf5-caad58c541fcbcec522d784b13100860b1d32f7a.tar.gz hdf5-caad58c541fcbcec522d784b13100860b1d32f7a.tar.bz2 |
[svn-r21239] Description:
Merged from HDF5 trunk r21237.
Add test cases for HDFFV-7656 - "--delta=something" considers two NaN of the same type are different.
The fix was added (r21105) before but test cases were incorrectly added and missing for cmake script.
Tested:
jam (linux32-LE), koala (linux64-LE), tejeda (mac32-LE), cmake (jam)
Diffstat (limited to 'tools')
-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 1b04f36..1fc3bbe 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -176,6 +176,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 @@ -347,6 +349,35 @@ IF (BUILD_TESTING) SET (last_test "H5DIFF-${resultfile}") ENDMACRO (ADD_H5_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 ### @@ -939,6 +970,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 |