diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5copy/testh5copy.sh.in | 10 | ||||
-rw-r--r-- | tools/h5dump/CMakeLists.txt | 29 | ||||
-rw-r--r-- | tools/h5dump/testh5dump.sh.in | 69 | ||||
-rw-r--r-- | tools/misc/h5cc.in | 19 | ||||
-rw-r--r--[-rwxr-xr-x] | tools/misc/h5perf_gentest.c | 0 | ||||
-rw-r--r-- | tools/misc/h5redeploy.in | 96 |
6 files changed, 171 insertions, 52 deletions
diff --git a/tools/h5copy/testh5copy.sh.in b/tools/h5copy/testh5copy.sh.in index d30d8d8..bec3bfc 100644 --- a/tools/h5copy/testh5copy.sh.in +++ b/tools/h5copy/testh5copy.sh.in @@ -513,7 +513,7 @@ COPY_REFERENCES() TESTFILE="$TESTDIR/h5copy_ref.h5" echo "Test copying object and region references" - TOOLTEST_F -f ref -i $TESTFILE -o $TESTDIR/region_ref.out.h5 -v -s / -d /COPY + TOOLTEST -f ref -i $TESTFILE -o $TESTDIR/region_ref.out.h5 -v -s / -d /COPY } # Copy external links. @@ -529,25 +529,25 @@ COPY_EXT_LINKS() TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_link.out.h5 -s /group_ext/extlink_dset -d /copy1_dset echo "Test copying external link directly with -f ext" - TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_link_f.out.h5 -v -s /group_ext/extlink_dset -d /copy2_dset + TOOLTEST -f ext -i $TESTFILE -o $TESTDIR/ext_link_f.out.h5 -v -s /group_ext/extlink_dset -d /copy2_dset echo "Test copying dangling external link (no obj) directly without -f ext" TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_dangle_noobj.out.h5 -s /group_ext/extlink_notyet1 -d /copy_dangle1_1 echo "Test copying dangling external link (no obj) directly with -f ext" - TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_noobj_f.out.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2 + TOOLTEST -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_noobj_f.out.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2 echo "Test copying dangling external link (no file) directly without -f ext" TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_dangle_nofile.out.h5 -s /group_ext/extlink_notyet2 -d /copy_dangle2_1 echo "Test copying dangling external link (no file) directly with -f ext" - TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_nofile_f.out.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2 + TOOLTEST -f ext -i $TESTFILE -o $TESTDIR/ext_dangle_nofile_f.out.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2 echo "Test copying a group contains external links without -f ext" TOOLTEST -v -i $TESTFILE -o $TESTDIR/ext_link_group.out.h5 -s /group_ext -d /copy1_group echo "Test copying a group contains external links with -f ext" - TOOLTEST_F -f ext -i $TESTFILE -o $TESTDIR/ext_link_group_f.out.h5 -v -s /group_ext -d /copy2_group + TOOLTEST -f ext -i $TESTFILE -o $TESTDIR/ext_link_group_f.out.h5 -v -s /group_ext -d /copy2_group } # Test misc. diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 3f39ae3..c7ebe63 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -906,6 +906,33 @@ IF (BUILD_TESTING) ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) ENDMACRO (ADD_H5ERR_MASK_TEST file) + MACRO (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + 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>" + -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=${resultfile}.ddl" + -D "TEST_ERRREF=${resultfile}.err" + -D "TEST_MASK_ERROR=true" + -D "TEST_ENV_VAR:STRING=${envvar}" + -D "TEST_ENV_VALUE:STRING=${envval}" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5ERR_MASK_ENV_TEST) + MACRO (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode) # If using memchecker add tests without using scripts IF (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -1655,7 +1682,7 @@ IF (BUILD_TESTING) ADD_H5ERR_MASK_TEST (textlink 0 --enable-error-stack textlink.h5) # test for error stack display (BZ2048) - ADD_H5ERR_MASK_TEST (filter_fail 1 --enable-error-stack filter_fail.h5) + ADD_H5ERR_MASK_ENV_TEST (filter_fail 1 "HDF5_PLUGIN_PRELOAD" "::" --enable-error-stack filter_fail.h5) # test for -o -y for dataset with attributes ADD_H5_TEST_EXPORT (tall-6 tall.h5 0 --enable-error-stack -d /g1/g1.1/dset1.1.1 -y -o) diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 238eee9..ceefc08 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -38,6 +38,9 @@ DIRNAME='dirname' LS='ls' AWK='awk' +# Skip plugin module to test missing filter +ENVCMD="env HDF5_PLUGIN_PRELOAD=::" + nerrors=0 verbose=yes @@ -721,6 +724,70 @@ TOOLTEST4() { } +# same as TOOLTEST4 but disables plugin filter loading +# silences extra error output on some platforms +# ADD_H5ERR_MASK_TEST +TOOLTEST5() { + + expect="$TESTDIR/$1" + expect_err="$TESTDIR/`basename $1 .ddl`.err" + actual="$TESTDIR/`basename $1 .ddl`.out" + actual_err="$TESTDIR/`basename $1 .ddl`.oerr" + actual_ext="$TESTDIR/`basename $1 .ddl`.ext" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav + shift + + # Run test. + TESTING $DUMPER $@ + ( + cd $TESTDIR + $ENVCMD $RUNSERIAL $DUMPER_BIN "$@" + ) >$actual 2>$actual_err + + # save actual and actual_err in case they are needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + cp $actual_err $actual_err_sav + STDERR_FILTER $actual_err + + # Extract file name, line number, version and thread IDs because they may be different + sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ + -e 's/line [0-9]*/line (number)/' \ + -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ + -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ + -e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \ + -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \ + $actual_err > $actual_ext + #cat $actual_ext >> $actual + + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + elif $CMP $expect $actual; then + if $CMP $expect_err $actual_ext; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.err) differs from actual result (*.oerr)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /' + fi + else + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err $actual_sav $actual_err_sav + fi + +} + # Print a "SKIP" message SKIP() { TESTING $DUMPER $@ @@ -1128,7 +1195,7 @@ TOOLTEST4 textlinkfar.ddl --enable-error-stack textlinkfar.h5 TOOLTEST4 textlink.ddl --enable-error-stack textlink.h5 # test for error stack display (BZ2048) -TOOLTEST4 filter_fail.ddl --enable-error-stack filter_fail.h5 +TOOLTEST5 filter_fail.ddl --enable-error-stack filter_fail.h5 # test for -o -y for dataset with attributes TOOLTEST2 tall-6.exp --enable-error-stack -y -o tall-6.txt -d /g1/g1.1/dset1.1.1 tall.h5 diff --git a/tools/misc/h5cc.in b/tools/misc/h5cc.in index fe11c26..f62c66f 100644 --- a/tools/misc/h5cc.in +++ b/tools/misc/h5cc.in @@ -132,8 +132,9 @@ usage() { echo " subdirectories [default: $prefix]" echo " -show Show the commands without executing them" echo " -showconfig Show the HDF5 library configuration summary" - echo " -shlib Compile with shared HDF5 libraries" - echo " -noshlib Compile with static HDF5 libraries [default]" + echo " -shlib Compile with shared HDF5 libraries [default when built with" + echo " disable-static]" + echo " -noshlib Compile with static HDF5 libraries [default when static available]" echo " " echo " <compile line> - the normal compile line options for your compiler." echo " $prog_name uses the same compiler you used to compile" @@ -350,20 +351,6 @@ if test "x$do_link" = "xyes"; then if test -n "$flag"; then shared_link="${flag}${libdir}" - # Any libraries in LDFLAGS or H5BLD_LDFLAGS also should have rpaths embedded - # in the executables created by h5cc (reduces need for LD_LIBRARY_PATH). - if test -n "$LDFLAGS"; then - for entry in $LDFLAGS; do - extdir=`echo $entry | sed '/^-L/ s/^-L//'` - shared_link="${shared_link} ${flag}${extdir}" - done - fi - if test -n "$H5BLD_LDFLAGS"; then - for entry in $H5BLD_LDFLAGS; do - extdir=`echo $entry | sed '/^-L/ s/^-L//'` - shared_link="${shared_link} ${flag}${extdir}" - done - fi fi if test "x$USE_SHARED_LIB" != "xyes"; then diff --git a/tools/misc/h5perf_gentest.c b/tools/misc/h5perf_gentest.c index 6a080d0..6a080d0 100755..100644 --- a/tools/misc/h5perf_gentest.c +++ b/tools/misc/h5perf_gentest.c diff --git a/tools/misc/h5redeploy.in b/tools/misc/h5redeploy.in index ae79b70..6b6ef87 100644 --- a/tools/misc/h5redeploy.in +++ b/tools/misc/h5redeploy.in @@ -14,9 +14,10 @@ # access to either file, you may request a copy from help@hdfgroup.org. # -## Update HDF5 compiler tools after the HDF5 software has been installed -## in a new location. -## For help page, use "h5redeploy -help" +## Update HDF5 compiler tools after the HDF5 software has been installed ## +## in a new location. ## +## For help page, use "h5redeploy -help" ## +## ## # Constants definitions EXIT_SUCCESS=0 @@ -29,14 +30,20 @@ usage() { # A wonderfully informative "usage" message. echo "usage: $prog_name [OPTIONS]" echo " OPTIONS:" - echo " -help|help This help message" - echo " -echo Show all the shell commands executed" - echo " -force No prompt, just do it" - echo " -prefix=DIR New directory to find HDF5 lib/ and include/" - echo " subdirectories [default: current directory]" - echo " -tool=TOOL Tool to update. TOOL must be in the current" - echo " directory and writable. [default: $h5tools]" - echo " -show Show the commands without executing them" + echo " -help|help This help message" + echo " -echo Show all the shell commands executed" + echo " -force No prompt, just do it" + echo " -prefix=DIR New directory to find HDF5 lib/ and include/" + echo " subdirectories [default: current directory]" + echo " -exec-prefix=DIR New directory to find HDF5 lib/" + echo " subdirectory [default: <prefix>]" + echo " -libdir=DIR New directory for the HDF5 lib directory" + echo " [default: <exec-prefix>/lib]" + echo " -includedir=DIR New directory for the HDF5 header files" + echo " [default: <prefix>/include]" + echo " -tool=TOOL Tool to update. TOOL must be in the current" + echo " directory and writable. [default: $h5tools]" + echo " -show Show the commands without executing them" echo " " exit $EXIT_FAILURE } @@ -70,17 +77,38 @@ ERROR() # Main # +############################################################################ +## Installation directories: ## +## prefix architecture-independent files. ## +## exec_prefix architecture-dependent files, default is <prefix>. ## +## libdir libraries, default is <exec_prefix>/lib. ## +## includedir header files, default is <prefix/include>. ## +## Not used here: ## +## bindir executables, <exec_prefix/bin>. ## +############################################################################ # Initialization h5tools="h5cc h5pcc h5fc h5pfc h5c++" # possible hdf5 tools foundtools= # tools found and will be modified fmode= # force mode, default is off -prefix=`(cd ..;pwd)` +prefix= +exec_prefix= +libdir= +includedir= # Parse options for arg in $@ ; do case "$arg" in -prefix=*) - prefix="`expr "$arg" : '-prefix=\(.*\)'`" + prefix="`echo $arg | cut -f2 -d=`" + ;; + -exec-prefix=*) + exec_prefix="`echo $arg | cut -f2 -d=`" + ;; + -libdir=*) + libdir="`echo $arg | cut -f2 -d=`" + ;; + -includedir=*) + includedir="`echo $arg | cut -f2 -d=`" ;; -echo) set -x @@ -89,7 +117,7 @@ for arg in $@ ; do SHOW="echo" ;; -tool=*) - h5tools="`expr "$arg" : '-tool=\(.*\)'`" + h5tools="`echo $arg | cut -f2 -d=`" ;; -help|help) usage @@ -105,10 +133,18 @@ for arg in $@ ; do esac done -# Sanity checks -if [ ! -d $prefix ]; then - ERROR "prefix($prefix) is not an existing directory" - exit $EXIT_FAILURE +# Set to default value, one above where i am, if not given by user +if [ -z "$prefix" ]; then + prefix=`(cd ..;pwd)` +fi +if [ -z "$exec_prefix" ]; then + exec_prefix='${prefix}' # use single quotes to prevent expansion of $ +fi +if [ -z "$libdir" ]; then + libdir='${exec_prefix}'/lib # use single quotes to prevent expansion of $ +fi +if [ -z "$includedir" ]; then + includedir='${prefix}'/include # use single quotes to prevent expansion of $ fi for x in $h5tools; do @@ -144,10 +180,19 @@ fi CMDFILE=/tmp/h5redeploy.$$ touch $CMDFILE chmod 0600 $CMDFILE -echo "/^prefix/c" >> $CMDFILE -echo prefix=\""$prefix"\" >> $CMDFILE -echo . >> $CMDFILE -(echo w; echo q) >> $CMDFILE +echo "/^prefix=/c" >> $CMDFILE +echo prefix=\""$prefix"\" >> $CMDFILE +echo . >> $CMDFILE +echo "/^exec_prefix=/c" >> $CMDFILE +echo exec_prefix=\""$exec_prefix"\" >> $CMDFILE +echo . >> $CMDFILE +echo "/^libdir=/c" >> $CMDFILE +echo libdir=\""$libdir"\" >> $CMDFILE +echo . >> $CMDFILE +echo "/^includedir=/c" >> $CMDFILE +echo includedir=\""$includedir"\" >> $CMDFILE +echo . >> $CMDFILE +(echo w; echo q) >> $CMDFILE # Update them @@ -171,10 +216,3 @@ done # Cleanup rm -f $CMDFILE exit $EXIT_SUCCESS - -# Some possible future features to add -# CCBASE - Name of the alternative C compiler -# CLINKERBASE - Name of the alternative linker -# LDFLAGS - Path to different libraries your application will link with -# (this path should include the path to the zlib library) -# LIBS - Libraries your application will link with |