summaryrefslogtreecommitdiffstats
path: root/tools/test
diff options
context:
space:
mode:
authorVailin Choi <vchoi@jam.ad.hdfgroup.org>2019-06-26 20:47:54 (GMT)
committerVailin Choi <vchoi@jam.ad.hdfgroup.org>2019-06-26 20:47:54 (GMT)
commit9cafc8d4de8bf63ed26a1e6c6e3b8d13b33b4567 (patch)
tree08b81869621fc3b6f7d6c14999a372ff33c3e03a /tools/test
parent7485981bcabfeb09ced49b840bf828c00816157a (diff)
parent439ea92d7e58c9900ef617bbe616a5ce36c709e9 (diff)
downloadhdf5-9cafc8d4de8bf63ed26a1e6c6e3b8d13b33b4567.zip
hdf5-9cafc8d4de8bf63ed26a1e6c6e3b8d13b33b4567.tar.gz
hdf5-9cafc8d4de8bf63ed26a1e6c6e3b8d13b33b4567.tar.bz2
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/~vchoi/my_third_fork into bugfix/new_shutdown_fsm
Diffstat (limited to 'tools/test')
-rw-r--r--tools/test/h5dump/CMakeTests.cmake30
-rw-r--r--tools/test/h5dump/testh5dump.sh.in35
2 files changed, 65 insertions, 0 deletions
diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake
index 13d71a6..070e98e 100644
--- a/tools/test/h5dump/CMakeTests.cmake
+++ b/tools/test/h5dump/CMakeTests.cmake
@@ -320,6 +320,7 @@
${HDF5_TOOLS_DIR}/testfiles/tvlenstr_array.h5
${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5
${HDF5_TOOLS_DIR}/testfiles/tvms.h5
+ ${HDF5_TOOLS_DIR}/testfiles/t128bit_float.h5
${HDF5_TOOLS_DIR}/testfiles/zerodim.h5
)
set (HDF5_ERROR_REFERENCE_TEST_FILES
@@ -674,6 +675,32 @@
endif ()
endmacro ()
+ macro (ADD_H5_GREP_TEST resultfile resultcode result_check)
+ 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}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_ARGS:STRING=${ARGN}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
+ -D "TEST_OUTPUT=${resultfile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${result_check}"
+ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
+ )
+ set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
+ endif ()
+ endmacro ()
+
macro (ADD_H5ERR_MASK_TEST resultfile resultcode result_errcheck)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
# Remove any output file left over from previous test run
@@ -1551,6 +1578,9 @@
# test to verify HDFFV-10333: error similar to H5O_attr_decode in the jira issue
ADD_H5_TEST (err_attr_dspace 1 err_attr_dspace.h5)
+ # test to verify HDFFV-9407: long double full precision
+ ADD_H5_GREP_TEST (t128bit_float 1 "1.123456789012345" -m %.35Lf t128bit_float.h5)
+
##############################################################################
### P L U G I N T E S T S
##############################################################################
diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in
index e1c02cf..e5680cf 100644
--- a/tools/test/h5dump/testh5dump.sh.in
+++ b/tools/test/h5dump/testh5dump.sh.in
@@ -34,6 +34,7 @@ H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary
RM='rm -rf'
CMP='cmp'
DIFF='diff -c'
+GREP='grep'
CP='cp'
DIRNAME='dirname'
LS='ls'
@@ -83,6 +84,7 @@ $SRC_H5DUMP_TESTFILES/charsets.h5
$SRC_H5DUMP_TESTFILES/file_space.h5
$SRC_H5DUMP_TESTFILES/filter_fail.h5
$SRC_H5DUMP_TESTFILES/packedbits.h5
+$SRC_H5DUMP_TESTFILES/t128bit_float.h5
$SRC_H5DUMP_TESTFILES/taindices.h5
$SRC_H5DUMP_TESTFILES/tall.h5
$SRC_H5DUMP_TESTFILES/tarray1.h5
@@ -903,6 +905,36 @@ TOOLTEST_HELP() {
}
+# Call the h5dump tool and grep for a value
+#
+GREPTEST()
+{
+ expectdata=$1
+ actual=$TESTDIR/$2
+ actual_err="$TESTDIR/`basename $2 .ddl`.oerr"
+ shift
+ shift
+
+ # Run test.
+ TESTING $DUMPER -p $@
+ (
+ cd $TESTDIR
+ $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@"
+ ) >$actual 2>$actual_err
+ $GREP $expectdata $actual > /dev/null
+ if [ $? -eq 0 ]; then
+ echo " PASSED"
+ else
+ echo " FAILED"
+ nerrors="`expr $nerrors + 1`"
+ fi
+
+ # Clean up output file
+ if test -z "$HDF5_NOCLEANUP"; then
+ rm -f $actual $actual_err
+ fi
+}
+
# Print a "SKIP" message
SKIP() {
TESTING $DUMPER $@
@@ -1363,6 +1395,9 @@ TOOLTEST3 non_existing.ddl --enable-error-stack tgroup.h5 non_existing.h5
# test to verify HDFFV-10333: error similar to H5O_attr_decode in the jira issue
TOOLTEST err_attr_dspace.ddl err_attr_dspace.h5
+# test to verify HDFFV-9407: long double full precision
+GREPTEST "1.123456789012345" t128bit_float.ddl -m %.35Lf t128bit_float.h5
+
# Clean up temporary files/directories
CLEAN_TESTFILES_AND_TESTDIR