summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2013-08-19 16:51:32 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2013-08-19 16:51:32 (GMT)
commit5c84b510304d5ae23eb1a7bedda8ce5eb816e414 (patch)
tree60c0a303691378612f48de4a174a34b9aaf45328
parent6e58f671ec62120246a94101a80a47259ffb96c3 (diff)
downloadhdf5-5c84b510304d5ae23eb1a7bedda8ce5eb816e414.zip
hdf5-5c84b510304d5ae23eb1a7bedda8ce5eb816e414.tar.gz
hdf5-5c84b510304d5ae23eb1a7bedda8ce5eb816e414.tar.bz2
[svn-r24024] JAVA-1714: CMake packaging for macs improved
HDFFV-7989: h5dump any_path and help text grouping Added cygwin-64 support Merged from trunk, tested local linux
-rw-r--r--CMakeLists.txt25
-rw-r--r--MANIFEST5
-rwxr-xr-xbin/cmakehdf54
-rwxr-xr-xbin/config.guess8
-rw-r--r--config/cmake/CPack.Info.plist.in37
-rw-r--r--config/cmake/CPack.cmake7
-rw-r--r--config/cmake/hdf.gifbin0 -> 1016 bytes
-rw-r--r--config/x86_64-pc-cygwin121
-rw-r--r--release_docs/RELEASE.txt5
-rw-r--r--tools/h5dump/CMakeLists.txt47
-rw-r--r--tools/h5dump/h5dump.c17
-rw-r--r--tools/h5dump/h5dump_ddl.c205
-rw-r--r--tools/h5dump/h5dump_ddl.h1
-rw-r--r--tools/h5dump/testh5dump.sh.in10
-rw-r--r--tools/h5stat/CMakeLists.txt91
-rw-r--r--tools/testfiles/h5dump-help.txt2
-rw-r--r--tools/testfiles/tall-7.ddl9
-rw-r--r--tools/testfiles/tall-7N.ddl17
-rw-r--r--tools/testfiles/tnofilename-with-packed-bits.ddl2
-rw-r--r--tools/testfiles/tpbitsIncomplete.ddl2
-rw-r--r--tools/testfiles/tpbitsLengthExceeded.ddl2
-rw-r--r--tools/testfiles/tpbitsLengthPositive.ddl2
-rw-r--r--tools/testfiles/tpbitsMaxExceeded.ddl2
-rw-r--r--tools/testfiles/tpbitsOffsetExceeded.ddl2
-rw-r--r--tools/testfiles/tpbitsOffsetNegative.ddl2
25 files changed, 613 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2c9f6be..a450199 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1199,16 +1199,37 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES)
ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs")
SET (CPACK_PACKAGE_RELOCATABLE TRUE)
+ SET (CPACK_GENERATOR "TGZ")
IF (WIN32)
- SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${HDF5_PACKAGE_NAME}-${HDF5_PACKAGE_VERSION}-${LIB_TYPE}")
+ LIST (APPEND CPACK_GENERATOR "NSIS")
+ SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${LIB_TYPE}")
SET (CPACK_MONOLITHIC_INSTALL ON)
SET (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}")
SET (CPACK_NSIS_MODIFY_PATH ON)
- SET (CPACK_NSIS_PACKAGE_NAME "HDF5 ${HDF5_PACKAGE_VERSION}")
+ SET (CPACK_NSIS_PACKAGE_NAME "HDF5 ${CPACK_PACKAGE_VERSION}")
ELSEIF (APPLE)
+ LIST (APPEND CPACK_GENERATOR "DragNDrop")
SET (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON)
SET (CPACK_PACKAGE_DEFAULT_LOCATION "/opt/${CPACK_PACKAGE_NAME}")
SET (CPACK_PACKAGING_INSTALL_PREFIX "/")
+ SET (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}")
+ SET (CPACK_PACKAGE_ICON "${HDF5_RESOURCES_DIR}/hdf.gif")
+ SET (CPACK_SET_DESTDIR TRUE) # Required when packaging, and set CMAKE_INSTALL_PREFIX to "/".
+
+ LIST (APPEND CPACK_GENERATOR "Bundle")
+ #-----------------------------------------------------------------------------
+ # Configure the Info.plist file for the install bundle
+ #-----------------------------------------------------------------------------
+ CONFIGURE_FILE (
+ ${HDF5_RESOURCES_DIR}/CPack.Info.plist.in
+ ${HDF5_BINARY_DIR}/CMakeFiles/Info.plist @ONLY
+ )
+ SET (CPACK_BUNDLE_NAME "${HDF5_PACKAGE_STRING}")
+ SET (CPACK_BUNDLE_LOCATION "/") # make sure CMAKE_INSTALL_PREFIX ends in /
+ SET (CMAKE_INSTALL_PREFIX "/${CPACK_BUNDLE_NAME}.framework/Versions/${CPACK_PACKAGE_VERSION}/${CPACK_PACKAGE_NAME}/")
+ SET (CPACK_BUNDLE_ICON "${HDF5_RESOURCES_DIR}/hdf.gif")
+ SET (CPACK_BUNDLE_PLIST "${HDF5_BINARY_DIR}/CMakeFiles/Info.plist")
+# SET (CPACK_BUNDLE_STARTUP_COMMAND "${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-startup.sh")
ELSE (WIN32)
SET (CPACK_PACKAGING_INSTALL_PREFIX "/usr")
SET (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON)
diff --git a/MANIFEST b/MANIFEST
index e1d2fb2..429be0b 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -112,6 +112,7 @@
./config/powerpc-ibm-aix5.x
./config/solaris2.x
./config/sv1-cray
+./config/x86_64-pc-cygwin
./config/x86_64-redstorm-linux-gnu
./config/site-specific/BlankForm
@@ -1246,6 +1247,8 @@
./tools/testfiles/tall-5s.ddl
./tools/testfiles/tall-6.ddl
./tools/testfiles/tall-6.exp
+./tools/testfiles/tall-7.ddl
+./tools/testfiles/tall-7N.ddl
./tools/testfiles/tall.h5
./tools/testfiles/tarray1.ddl
./tools/testfiles/tarray1.h5
@@ -2261,6 +2264,8 @@
./config/cmake/CTestCustom.cmake
./config/cmake/ConfigureChecks.cmake
./config/cmake/CPack.cmake
+./config/cmake/CPack.Info.plist.in
+./config/cmake/hdf.gif
./config/cmake/NSIS.template.in
./config/cmake/NSIS.InstallOptions.ini.in
diff --git a/bin/cmakehdf5 b/bin/cmakehdf5
index 2480497..874df5d 100755
--- a/bin/cmakehdf5
+++ b/bin/cmakehdf5
@@ -76,7 +76,7 @@ set (CTEST_MAX_N 8)
set (LOCAL_NO_SUBMIT TRUE) # No CDash submit.
set (MODEL "Experimental")
set (CDASH_LOCAL TRUE)
-set (SITE_BUILDNAME_SUFFIX "SHARED")
+set (SITE_BUILDNAME_SUFFIX "cmakehdf5")
# -- URL set for internal check, default is to not update
set (LOCAL_SKIP_UPDATE TRUE)
@@ -225,7 +225,7 @@ EOF
# Run ctest
-ctest -S $cfgfile -C Release -O ctest.log
+ctest -S $cfgfile -C Release -V -O ctest.log
exit_code=$?
if [ $exit_code = 0 ]; then
echo Complete without error
diff --git a/bin/config.guess b/bin/config.guess
index f32079a..03fe473 100755
--- a/bin/config.guess
+++ b/bin/config.guess
@@ -778,9 +778,9 @@ EOF
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
+ i*:CYGWIN*:* | x*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
@@ -815,7 +815,7 @@ EOF
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit ;;
- amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ amd64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
p*:CYGWIN*:*)
diff --git a/config/cmake/CPack.Info.plist.in b/config/cmake/CPack.Info.plist.in
new file mode 100644
index 0000000..a701a61
--- /dev/null
+++ b/config/cmake/CPack.Info.plist.in
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+
+<plist version="1.0">
+<dict>
+<key>IFMajorVersion</key>
+<integer>@CPACK_PACKAGE_VERSION_MAJOR@</integer>
+<key>IFMinorVersion</key>
+<integer>@CPACK_PACKAGE_VERSION_MINOR@</integer>
+<key>IFPkgFlagAllowBackRev</key>
+<false/>
+<key>IFPkgFlagAuthorizationAction</key>
+<string>AdminAuthorization</string>
+<key>IFPkgFlagDefaultLocation</key>
+<string>@CPACK_PACKAGE_DEFAULT_LOCATION@</string>
+<key>IFPkgFlagInstallFat</key>
+<false/>
+<key>IFPkgFlagIsRequired</key>
+<false/>
+<key>IFPkgFlagOverwritePermissions</key>
+<true/>
+<key>IFPkgFlagRelocatable</key>
+<@CPACK_PACKAGE_RELOCATABLE@/>
+<key>IFPkgFlagRestartAction</key>
+<string>NoRestart</string>
+<key>IFPkgFlagRootVolumeOnly</key>
+<false/>
+<key>IFPkgFlagUpdateInstalledLanguages</key>
+<false/>
+<key>IFPkgFlagUseUserMask</key>
+<false/>
+<key>IFPkgFormatVersion</key>
+<real>0.10000000149011612</real>
+<key>CFBundleIdentifier</key>
+<string>org.@CPACK_PACKAGE_VENDOR@.@CPACK_PACKAGE_NAME@@CPACK_MODULE_VERSION_SUFFIX@</string>
+</dict>
+</plist>
diff --git a/config/cmake/CPack.cmake b/config/cmake/CPack.cmake
index d96fe43..bdfa5b8 100644
--- a/config/cmake/CPack.cmake
+++ b/config/cmake/CPack.cmake
@@ -442,6 +442,7 @@ if(NOT CPACK_GENERATOR)
endif()
else()
option(CPACK_BINARY_NSIS "Enable to build NSIS packages" ON)
+ option(CPACK_BINARY_WIX "Enable to build WiX packages" OFF)
option(CPACK_BINARY_ZIP "Enable to build ZIP packages" OFF)
endif()
@@ -457,6 +458,7 @@ if(NOT CPACK_GENERATOR)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TGZ TGZ)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TBZ2 TBZ2)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TZ TZ)
+ cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_WIX WIX)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_ZIP ZIP)
endif()
@@ -487,7 +489,7 @@ endif()
mark_as_advanced(CPACK_BINARY_CYGWIN CPACK_BINARY_PACKAGEMAKER CPACK_BINARY_OSXX11
CPACK_BINARY_STGZ CPACK_BINARY_TGZ CPACK_BINARY_TBZ2
CPACK_BINARY_DEB CPACK_BINARY_RPM CPACK_BINARY_TZ
- CPACK_BINARY_NSIS CPACK_BINARY_ZIP CPACK_BINARY_BUNDLE
+ CPACK_BINARY_NSIS CPACK_BINARY_WIX CPACK_BINARY_ZIP CPACK_BINARY_BUNDLE
CPACK_SOURCE_CYGWIN CPACK_SOURCE_TBZ2 CPACK_SOURCE_TGZ
CPACK_SOURCE_TZ CPACK_SOURCE_ZIP CPACK_BINARY_DRAGNDROP)
@@ -526,6 +528,9 @@ cpack_set_if_not_set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
cpack_set_if_not_set(CPACK_NSIS_INSTALLER_ICON_CODE "")
cpack_set_if_not_set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
+# WiX specific variables
+cpack_set_if_not_set(CPACK_WIX_SIZEOF_VOID_P "${CMAKE_SIZEOF_VOID_P}")
+
if(DEFINED CPACK_COMPONENTS_ALL)
if(CPACK_MONOLITHIC_INSTALL)
message("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.")
diff --git a/config/cmake/hdf.gif b/config/cmake/hdf.gif
new file mode 100644
index 0000000..656617b
--- /dev/null
+++ b/config/cmake/hdf.gif
Binary files differ
diff --git a/config/x86_64-pc-cygwin b/config/x86_64-pc-cygwin
new file mode 100644
index 0000000..9b1ab74
--- /dev/null
+++ b/config/x86_64-pc-cygwin
@@ -0,0 +1,121 @@
+# -*- shell-script -*-
+#
+# Copyright by The HDF Group.
+# Copyright by the Board of Trustees of the University of Illinois.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the files COPYING and Copyright.html. COPYING can be found at the root
+# of the source code distribution tree; Copyright.html can be found at the
+# root level of an installed copy of the electronic HDF5 document set and
+# is linked from the top-level documents page. It can also be found at
+# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
+# access to either file, you may request a copy from help@hdfgroup.org.
+
+
+# This file is part of the HDF5 build script. It is processed shortly
+# after configure starts and defines, among other things, flags for
+# the various compile modes.
+#
+# See BlankForm in this directory for details.
+
+# The default compiler is `gcc'.
+if test -z "$CC"; then
+ CC=gcc
+ CC_BASENAME=gcc
+fi
+
+# Figure out GNU C compiler flags
+. $srcdir/config/gnu-flags
+
+# Figure out PGI C compiler flags
+. $srcdir/config/pgi-flags
+
+# Figure out Intel C compiler flags
+. $srcdir/config/intel-flags
+
+# The default Fortran 90 compiler
+if test "X-" = "X-$FC"; then
+ case $CC_BASENAME in
+ gcc*)
+ FC=gfortran
+ FCLIBS=-lgcc
+ FC_BASENAME=gfortran
+ ;;
+ pgcc*)
+ FC=pgf90
+ FC_BASENAME=pgf90
+ ;;
+ icc*)
+ FC=ifort
+ FC_BASENAME=ifort
+ ;;
+ mpicc*)
+ FC=mpif90
+ FC_BASENAME=mpif90
+ ;;
+ esac
+else
+ case $FC in
+ # The PGI and Intel compilers are automatically detected below
+ ifc*|ifort*|pgf90*)
+ ;;
+ gfortran)
+ FCLIBS=-lgcc
+ ;;
+ g95)
+ FCLIBS=-lgcc
+ ;;
+ *)
+ # Figure out which compiler we are using: pgf90 or Absoft f95
+ RM='rm -f'
+ tmpfile=/tmp/cmpver.$$
+ $FC -V >$tmpfile
+ if test -s "$tmpfile"; then
+ if( grep -s 'Absoft' $tmpfile > /dev/null) then
+ FC_BASENAME=f95
+ fi
+ if( grep -s 'pgf90' $tmpfile > /dev/null) then
+ FC_BASENAME=pgf90
+ fi
+ fi
+ $RM $tmpfile
+ ;;
+ esac
+fi
+
+# Figure out PGI F90 compiler flags
+. $srcdir/config/pgi-fflags
+
+# Figure out Intel F90 compiler flags
+. $srcdir/config/intel-fflags
+
+case $FC_BASENAME in
+ #
+ # Absoft compiler
+ #
+ f95)
+ # Set required flag for compiling C stubs
+ H5_CFLAGS="$H5_CFLAGS -DH5_ABSOFT"
+
+ F9XSUFFIXFLAG=""
+# We force compiler to use upper case for external names
+# (just in case since this should be a default EIP)
+ H5_FCFLAGS="$H5_FCFLAGS -YEXT_NAMES=UCS"
+ FSEARCH_DIRS=""
+ DEBUG_FCFLAGS="-g"
+ PROD_FCFLAGS="-O"
+ PROFILE_FCFLAGS="-g -pg"
+ f9x_flags_set=yes
+ ;;
+
+esac
+
+# The default C++ compiler
+
+# The default compiler is `g++'.
+if test -z "$CXX"; then
+ CXX=g++
+ CXX_BASENAME=g++
+fi
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 33b85f0..be3b556 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -70,7 +70,10 @@ New Features
Tools
-----
- - None
+ - h5dump: Added option -N --any_path, which searches the file for paths that
+ match the search path. HDFFV-7989 (ADB - 2013/08/12).
+ - h5dump: Added optional arg 0 to -A, which excludes attributes from display.
+ HDFFV-8134 (ADB - 2013/08/01).
High-Level APIs
---------------
diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt
index f14ff1b..f5a5a9b 100644
--- a/tools/h5dump/CMakeLists.txt
+++ b/tools/h5dump/CMakeLists.txt
@@ -57,6 +57,8 @@ IF (BUILD_TESTING)
${HDF5_TOOLS_SRC_DIR}/testfiles/tall-4s.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tall-5s.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tall-6.ddl
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-7.ddl
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-7N.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tallfilters.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1_big.ddl
@@ -750,6 +752,39 @@ IF (BUILD_TESTING)
ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
ENDMACRO (ADD_H5_TEST file)
+ MACRO (ADD_H5_TEST_N resultfile resultcode)
+ # If using memchecker add tests without using scripts
+ IF (HDF5_ENABLE_USING_MEMCHECKER)
+ ADD_TEST (NAME H5DUMP-N-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN})
+ SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ IF (NOT ${resultcode} STREQUAL "0")
+ SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true")
+ ENDIF (NOT ${resultcode} STREQUAL "0")
+ IF (NOT "${last_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES DEPENDS ${last_test})
+ ENDIF (NOT "${last_test}" STREQUAL "")
+ ELSE (HDF5_ENABLE_USING_MEMCHECKER)
+ ADD_TEST (
+ NAME H5DUMP-N-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove ${resultfile}-N.bin ${resultfile}-N.out ${resultfile}-N.out.err
+ )
+ SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ ADD_TEST (
+ NAME H5DUMP-N-${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}-N.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}.ddl"
+ -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ )
+ SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES DEPENDS "H5DUMP-N-${resultfile}-clear-objects")
+ ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
+ ENDMACRO (ADD_H5_TEST_N file)
+
MACRO (ADD_H5_TEST_EXPORT resultfile targetfile resultcode)
# If using memchecker add tests without using scripts
IF (HDF5_ENABLE_USING_MEMCHECKER)
@@ -1083,6 +1118,10 @@ IF (BUILD_TESTING)
tall-6.txt
tall-6.out
tall-6.out.err
+ tall-7.out
+ tall-7.out.err
+ tall-7N.out
+ tall-7N.out.err
tallfilters.out
tallfilters.out.err
tarray1.out
@@ -1411,6 +1450,7 @@ IF (BUILD_TESTING)
ADD_H5_TEST (tattr-1 0 --enable-error-stack tattr.h5)
# test for displaying the selected attributes of string type and scalar space
ADD_H5_TEST (tattr-2 0 --enable-error-stack -a /\\\\/attr1 --attribute /attr4 --attribute=/attr5 tattr.h5)
+ ADD_H5_TEST_N (tattr-2 0 --enable-error-stack -N /\\\\/attr1 --any_path /attr4 --any_path=/attr5 tattr.h5)
# test for header and error messages
ADD_H5ERR_MASK_TEST (tattr-3 1 --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5)
# test for displaying attributes in shared datatype (also in group and dataset)
@@ -1423,6 +1463,7 @@ IF (BUILD_TESTING)
ADD_H5_TEST (tudlink-1 0 --enable-error-stack tudlink.h5)
# test for displaying the selected link
ADD_H5_TEST (tslink-2 0 --enable-error-stack -l slink2 tslink.h5)
+ ADD_H5_TEST_N (tslink-2 0 --enable-error-stack -N slink2 tslink.h5)
ADD_H5_TEST (tudlink-2 0 --enable-error-stack -l udlink2 tudlink.h5)
# test for displaying dangling soft links
ADD_H5ERR_MASK_TEST (tslink-D 0 --enable-error-stack -d /slink1 tslink.h5)
@@ -1432,12 +1473,15 @@ IF (BUILD_TESTING)
ADD_H5_TEST (thlink-2 0 --enable-error-stack -d /g1/dset2 --dataset /dset1 --dataset=/g1/g1.1/dset3 thlink.h5)
ADD_H5_TEST (thlink-3 0 --enable-error-stack -d /g1/g1.1/dset3 --dataset /g1/dset2 --dataset=/dset1 thlink.h5)
ADD_H5_TEST (thlink-4 0 --enable-error-stack -g /g1 thlink.h5)
+ ADD_H5_TEST_N (thlink-4 0 --enable-error-stack -N /g1 thlink.h5)
ADD_H5_TEST (thlink-5 0 --enable-error-stack -d /dset1 -g /g2 -d /g1/dset2 thlink.h5)
+ ADD_H5_TEST_N (thlink-5 0 --enable-error-stack -N /dset1 -N /g2 -N /g1/dset2 thlink.h5)
# tests for compound data types
ADD_H5_TEST (tcomp-1 0 --enable-error-stack tcompound.h5)
# test for named data types
ADD_H5_TEST (tcomp-2 0 --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5)
+ ADD_H5_TEST_N (tcomp-2 0 --enable-error-stack -N /type1 --any_path /type2 --any_path=/group1/type3 tcompound.h5)
# test for unamed type
ADD_H5ERR_MASK_TEST (tcomp-3 0 "--enable-error-stack;-t;/#6632;-g;/group2;tcompound.h5")
# test complicated compound datatype
@@ -1451,6 +1495,9 @@ IF (BUILD_TESTING)
ADD_H5ERR_MASK_TEST (tall-1 0 --enable-error-stack tall.h5)
ADD_H5_TEST (tall-2 0 --enable-error-stack --header -g /g1/g1.1 -a attr2 tall.h5)
ADD_H5_TEST (tall-3 0 --enable-error-stack -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5)
+ ADD_H5_TEST_N (tall-3 0 --enable-error-stack -N /g2/dset2.1 -N /g1/g1.2/g1.2.1/slink tall.h5)
+ ADD_H5_TEST (tall-7 0 --enable-error-stack -a attr1 tall.h5)
+ ADD_H5_TEST (tall-7N 0 --enable-error-stack -N attr1 tall.h5)
# test for loop detection
ADD_H5_TEST (tloop-1 0 --enable-error-stack tloop.h5)
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 8a2e503..ea38c61 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -71,7 +71,7 @@ struct handler_t {
*/
/* The following initialization makes use of C language cancatenating */
/* "xxx" "yyy" into "xxxyyy". */
-static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:A*q:z:m:RECM:O*";
+static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:A*q:z:m:RECM:O*N:";
static struct long_options l_opts[] = {
{ "help", no_arg, 'h' },
{ "hel", no_arg, 'h' },
@@ -188,6 +188,7 @@ static struct long_options l_opts[] = {
{ "packed-bits", require_arg, 'M' },
{ "no-compact-subset", no_arg, 'C' },
{ "ddl", optional_arg, 'O' },
+ { "any_path", require_arg, 'N' },
{ NULL, 0, '\0' }
};
@@ -250,6 +251,8 @@ usage(const char *prog)
PRINTVALSTREAM(rawoutstream, " -g P, --group=P Print the specified group and all members\n");
PRINTVALSTREAM(rawoutstream, " -l P, --soft-link=P Print the value(s) of the specified soft link\n");
PRINTVALSTREAM(rawoutstream, " -t P, --datatype=P Print the specified named datatype\n");
+ PRINTVALSTREAM(rawoutstream, " -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P\n");
+ PRINTVALSTREAM(rawoutstream, " P can be the absolute path or just a relative path.\n");
PRINTVALSTREAM(rawoutstream, " -A, --onlyattr Print the header and value of attributes\n");
PRINTVALSTREAM(rawoutstream, " Optional value 0 suppresses printing attributes.\n");
PRINTVALSTREAM(rawoutstream, "--------------- Object Property Options ---------------\n");
@@ -958,6 +961,18 @@ parse_start:
}
last_was_dset = FALSE;
break;
+ case 'N':
+ display_all = 0;
+
+ for (i = 0; i < argc; i++)
+ if (!hand[i].func) {
+ hand[i].func = handle_paths;
+ hand[i].obj = HDstrdup(opt_arg);
+ break;
+ }
+
+ last_was_dset = FALSE;
+ break;
case 'a':
display_all = 0;
diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c
index d5ee06e..e2b2ff7 100644
--- a/tools/h5dump/h5dump_ddl.c
+++ b/tools/h5dump/h5dump_ddl.c
@@ -24,6 +24,16 @@
#include "h5dump_extern.h"
#include "h5dump_ddl.h"
+typedef struct {
+ hid_t fid; /* File ID being traversed */
+ char *op_name; /* Object name wanted */
+} trav_handle_udata_t;
+
+typedef struct {
+ char *path; /* Path of object being searched */
+ char *op_name; /* Object name wanted */
+} trav_attr_udata_t;
+
/* callback function used by H5Literate() */
static herr_t dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void *op_data);
static int dump_extlink(hid_t group, const char *linkname, const char *objname);
@@ -1274,6 +1284,200 @@ dump_fcontents(hid_t fid)
PRINTSTREAM(rawoutstream, " %s\n",END);
}
+static herr_t
+attr_search(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *ainfo, void *_op_data)
+{
+ herr_t ret = SUCCEED;
+ int i;
+ int j;
+ int k;
+ char *obj_op_name;
+ char *obj_name;
+ trav_attr_udata_t *attr_data = (trav_attr_udata_t*)_op_data;
+ char *buf = attr_data->path;
+ char *op_name = attr_data->op_name;
+
+ j = (int)HDstrlen(op_name) - 1;
+ /* find the last / */
+ while(j >= 0) {
+ if (op_name[j] == '/' && (j==0 || (j>0 && op_name[j-1]!='\\')))
+ break;
+ j--;
+ }
+
+ obj_op_name = h5tools_str_replace(op_name + j + 1, "\\/", "/");
+
+ if(obj_op_name == NULL) {
+ h5tools_setstatus(EXIT_FAILURE);
+ ret = FAIL;
+ }
+ else {
+ if(HDstrcmp(attr_name, obj_op_name)==0) {
+ /* object name */
+ i = (int)HDstrlen(buf);
+ j = (int)HDstrlen(op_name);
+ k = (size_t)i + 1 + (size_t)j + 1 + 2;
+ obj_name = (char *)HDmalloc((size_t)k);
+ if(obj_name == NULL) {
+ h5tools_setstatus(EXIT_FAILURE);
+ ret = FAIL;
+ }
+ else {
+ HDmemset(obj_name, '\0', (size_t)k);
+ if(op_name[0] != '/') {
+ HDstrncat(obj_name, buf, (size_t)i + 1);
+ if(buf[i-1] != '/')
+ HDstrncat(obj_name, "/", 2);
+ }
+ HDstrncat(obj_name, op_name, (size_t)j + 1);
+
+ handle_attributes(oid, obj_name, NULL, 0, NULL);
+ HDfree(obj_name);
+ }
+ }
+ HDfree(obj_op_name);
+ }
+ return ret;
+} /* end attr_search() */
+
+static herr_t
+obj_search(const char *path, const H5O_info_t *oi, const char *already_visited, void *_op_data)
+{
+ trav_handle_udata_t *handle_data = (trav_handle_udata_t*)_op_data;
+ char *op_name = (char*)handle_data->op_name;
+
+ trav_attr_udata_t attr_data;
+ attr_data.path = (char*)path;
+ attr_data.op_name = op_name;
+ H5Aiterate_by_name(handle_data->fid, path, H5_INDEX_NAME, H5_ITER_INC, NULL, attr_search, (void*)&attr_data, H5P_DEFAULT);
+
+ if(HDstrcmp(path, op_name)==0) {
+ switch(oi->type) {
+ case H5O_TYPE_GROUP:
+ handle_groups(handle_data->fid, path, NULL, 0, NULL);
+ break;
+ case H5O_TYPE_DATASET:
+ handle_datasets(handle_data->fid, path, NULL, 0, NULL);
+ break;
+ case H5O_TYPE_NAMED_DATATYPE:
+ handle_datatypes(handle_data->fid, path, NULL, 0, NULL);
+ break;
+ case H5O_TYPE_UNKNOWN:
+ case H5O_TYPE_NTYPES:
+ default:
+ error_msg("unknown object type value\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ } /* end switch */
+ }
+
+ return 0;
+} /* end obj_search() */
+
+static herr_t
+lnk_search(const char *path, const H5L_info_t *li, void *_op_data)
+{
+ int search_len;
+ int k;
+ char *search_name;
+ trav_handle_udata_t *handle_data = (trav_handle_udata_t*)_op_data;
+ char *op_name = (char*)handle_data->op_name;
+
+ search_len = HDstrlen(op_name);
+ if(search_len > 0 && op_name[0] != '/') {
+ k = 2;
+ }
+ else
+ k = 1;
+ search_name = (char *)HDmalloc(search_len + k);
+ if(search_name == NULL) {
+ error_msg("creating temporary link\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ }
+ else {
+ if (k == 2) {
+ HDstrcpy(search_name, "/");
+ HDstrncat(search_name, op_name, (size_t)search_len + 1);
+ }
+ else
+ HDstrncpy(search_name, op_name, (size_t)search_len + 1);
+ search_name[search_len + k - 1] = '\0';
+
+ if(HDstrcmp(path, search_name) == 0) {
+ switch(li->type) {
+ case H5L_TYPE_SOFT:
+ case H5L_TYPE_EXTERNAL:
+ handle_links(handle_data->fid, op_name, NULL, 0, NULL);
+ break;
+
+ case H5L_TYPE_HARD:
+ case H5L_TYPE_MAX:
+ case H5L_TYPE_ERROR:
+ default:
+ error_msg("unknown link type value\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ break;
+ } /* end switch() */
+ }
+ HDfree(search_name);
+ }
+ return 0;
+} /* end lnk_search() */
+
+/*-------------------------------------------------------------------------
+ * Function: handle_paths
+ *
+ * Purpose: Handle objects from the command.
+ *
+ * Return: void
+ *
+ *-------------------------------------------------------------------------
+ */
+void
+handle_paths(hid_t fid, const char *path_name, void* data, int pe, const char *display_name)
+{
+ hid_t gid = -1;
+
+ if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) {
+ error_msg("unable to open root group\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ }
+ else {
+ hid_t gcpl_id;
+ unsigned crt_order_flags;
+ unsigned attr_crt_order_flags;
+ trav_handle_udata_t handle_udata; /* User data for traversal */
+
+ if ((gcpl_id = H5Gget_create_plist(gid)) < 0) {
+ error_msg("error in getting group creation property list ID\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ }
+
+ /* query the group creation properties for attributes */
+ if (H5Pget_attr_creation_order(gcpl_id, &attr_crt_order_flags) < 0) {
+ error_msg("error in getting group creation properties\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ }
+
+ /* query the group creation properties */
+ if(H5Pget_link_creation_order(gcpl_id, &crt_order_flags) < 0) {
+ error_msg("error in getting group creation properties\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ }
+
+ if(H5Pclose(gcpl_id) < 0) {
+ error_msg("error in closing group creation property list ID\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ }
+
+ handle_udata.fid = fid;
+ handle_udata.op_name = (char*)path_name;
+ if(h5trav_visit(fid, "/", TRUE, TRUE, obj_search, lnk_search, &handle_udata) < 0) {
+ error_msg("error traversing information\n");
+ h5tools_setstatus(EXIT_FAILURE);
+ }
+ }
+}
+
/*-------------------------------------------------------------------------
* Function: handle_attributes
*
@@ -1349,7 +1553,6 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe
attr_name = h5tools_str_replace(attr + j + 1, "\\/", "/");
-
/* handle error case: cannot open the object with the attribute */
if((oid = H5Oopen(fid, obj_name, H5P_DEFAULT)) < 0) {
/* setup */
diff --git a/tools/h5dump/h5dump_ddl.h b/tools/h5dump/h5dump_ddl.h
index eccc3bc..c4f4638 100644
--- a/tools/h5dump/h5dump_ddl.h
+++ b/tools/h5dump/h5dump_ddl.h
@@ -34,6 +34,7 @@ void dump_fcontents(hid_t fid);
/* callback function used by H5Aiterate2() */
herr_t dump_attr_cb(hid_t loc_id, const char *attr_name, const H5A_info_t *info, void *_op_data);
+void handle_paths(hid_t fid, const char *path_name, void *data, int pe, const char *display_name);
void handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *display_name);
void handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe, const char UNUSED *display_name);
void handle_groups(hid_t fid, const char *group, void UNUSED *data, int pe, const char *display_name);
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index c90cba4..3a06c57 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -180,6 +180,8 @@ $SRC_H5DUMP_TESTFILES/tall-4s.ddl
$SRC_H5DUMP_TESTFILES/tall-5s.ddl
$SRC_H5DUMP_TESTFILES/tall-6.ddl
$SRC_H5DUMP_TESTFILES/tall-6.exp
+$SRC_H5DUMP_TESTFILES/tall-7.ddl
+$SRC_H5DUMP_TESTFILES/tall-7N.ddl
$SRC_H5DUMP_TESTFILES/tallfilters.ddl
$SRC_H5DUMP_TESTFILES/tarray1.ddl
$SRC_H5DUMP_TESTFILES/tarray1_big.ddl
@@ -910,6 +912,7 @@ TOOLTEST4 tdset-2.ddl --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3
TOOLTEST tattr-1.ddl --enable-error-stack tattr.h5
# test for displaying the selected attributes of string type and scalar space
TOOLTEST tattr-2.ddl --enable-error-stack -a "/\/attr1" --attribute /attr4 --attribute=/attr5 tattr.h5
+TOOLTEST tattr-2.ddl --enable-error-stack -N "/\/attr1" --any_path /attr4 --any_path=/attr5 tattr.h5
# test for header and error messages
TOOLTEST4 tattr-3.ddl --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5
# test for displaying at least 9 attributes on root from a BE machine
@@ -922,6 +925,7 @@ TOOLTEST tslink-1.ddl --enable-error-stack tslink.h5
TOOLTEST tudlink-1.ddl --enable-error-stack tudlink.h5
# test for displaying the selected link
TOOLTEST tslink-2.ddl --enable-error-stack -l slink2 tslink.h5
+TOOLTEST tslink-2.ddl --enable-error-stack -N slink2 tslink.h5
TOOLTEST tudlink-2.ddl --enable-error-stack -l udlink2 tudlink.h5
# test for displaying dangling soft links
TOOLTEST4 tslink-D.ddl --enable-error-stack -d /slink1 tslink.h5
@@ -931,12 +935,15 @@ TOOLTEST thlink-1.ddl --enable-error-stack thlink.h5
TOOLTEST thlink-2.ddl --enable-error-stack -d /g1/dset2 --dataset /dset1 --dataset=/g1/g1.1/dset3 thlink.h5
TOOLTEST thlink-3.ddl --enable-error-stack -d /g1/g1.1/dset3 --dataset /g1/dset2 --dataset=/dset1 thlink.h5
TOOLTEST thlink-4.ddl --enable-error-stack -g /g1 thlink.h5
+TOOLTEST thlink-4.ddl --enable-error-stack -N /g1 thlink.h5
TOOLTEST thlink-5.ddl --enable-error-stack -d /dset1 -g /g2 -d /g1/dset2 thlink.h5
+TOOLTEST thlink-5.ddl --enable-error-stack -N /dset1 -N /g2 -N /g1/dset2 thlink.h5
# tests for compound data types
TOOLTEST tcomp-1.ddl --enable-error-stack tcompound.h5
# test for named data types
TOOLTEST tcomp-2.ddl --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5
+TOOLTEST tcomp-2.ddl --enable-error-stack -N /type1 --any_path /type2 --any_path=/group1/type3 tcompound.h5
# test for unamed type
TOOLTEST4 tcomp-3.ddl --enable-error-stack -t /#6632 -g /group2 tcompound.h5
# test complicated compound datatype
@@ -950,6 +957,9 @@ TOOLTEST tnestedcmpddt.ddl --enable-error-stack tnestedcmpddt.h5
TOOLTEST4 tall-1.ddl --enable-error-stack tall.h5
TOOLTEST tall-2.ddl --enable-error-stack --header -g /g1/g1.1 -a attr2 tall.h5
TOOLTEST tall-3.ddl --enable-error-stack -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5
+TOOLTEST tall-3.ddl --enable-error-stack -N /g2/dset2.1 -N /g1/g1.2/g1.2.1/slink tall.h5
+TOOLTEST tall-7.ddl --enable-error-stack -a attr1 tall.h5
+TOOLTEST tall-7N.ddl --enable-error-stack -N attr1 tall.h5
# test for loop detection
TOOLTEST tloop-1.ddl --enable-error-stack tloop.h5
diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt
index 78f39dd..4a775ee 100644
--- a/tools/h5stat/CMakeLists.txt
+++ b/tools/h5stat/CMakeLists.txt
@@ -44,6 +44,7 @@ IF (BUILD_TESTING)
h5stat_help1.ddl
h5stat_help2.ddl
h5stat_notexist.ddl
+ h5stat_nofile.ddl
h5stat_filters.ddl
h5stat_filters-file.ddl
h5stat_filters-F.ddl
@@ -56,11 +57,27 @@ IF (BUILD_TESTING)
h5stat_newgrat.ddl
h5stat_newgrat-UG.ddl
h5stat_newgrat-UA.ddl
+ h5stat_err1_links.ddl
+ h5stat_links1.ddl
+ h5stat_links2.ddl
+ h5stat_links3.ddl
+ h5stat_links4.ddl
+ h5stat_links5.ddl
+ h5stat_err1_dims.ddl
+ h5stat_dims1.ddl
+ h5stat_dims2.ddl
+ h5stat_err1_numattrs.ddl
+ h5stat_err2_numattrs.ddl
+ h5stat_numattrs1.ddl
+ h5stat_numattrs2.ddl
+ h5stat_numattrs3.ddl
+ h5stat_numattrs4.ddl
)
SET (HDF5_REFERENCE_TEST_FILES
h5stat_filters.h5
h5stat_tsohm.h5
h5stat_newgrat.h5
+ h5stat_threshold.h5
)
FOREACH (ddl_file ${HDF5_REFERENCE_FILES})
@@ -140,6 +157,8 @@ IF (BUILD_TESTING)
h5stat_help2.out.err
h5stat_notexist.out
h5stat_notexist.out.err
+ h5stat_nofile.out
+ h5stat_nofile.out.err
h5stat_filters.out
h5stat_filters.out.err
h5stat_filters-file.out
@@ -164,6 +183,36 @@ IF (BUILD_TESTING)
h5stat_newgrat-UG.out.err
h5stat_newgrat-UA.out
h5stat_newgrat-UA.out.err
+ h5stat_err1_links.out
+ h5stat_err1_links.out.err
+ h5stat_links1.out
+ h5stat_links1.out.err
+ h5stat_links2.out
+ h5stat_links2.out.err
+ h5stat_links3.out
+ h5stat_links3.out.err
+ h5stat_links4.out
+ h5stat_links4.out.err
+ h5stat_links5.out
+ h5stat_links5.out.err
+ h5stat_err1_dims.out
+ h5stat_err1_dims.out.err
+ h5stat_dims1.out
+ h5stat_dims1.out.err
+ h5stat_dims2.out
+ h5stat_dims2.out.err
+ h5stat_err1_numattrs.out
+ h5stat_err1_numattrs.out.err
+ h5stat_err2_numattrs.out
+ h5stat_err2_numattrs.out.err
+ h5stat_numattrs1.out
+ h5stat_numattrs1.out.err
+ h5stat_numattrs2.out
+ h5stat_numattrs2.out.err
+ h5stat_numattrs3.out
+ h5stat_numattrs3.out.err
+ h5stat_numattrs4.out
+ h5stat_numattrs4.out.err
)
IF (NOT "${last_test}" STREQUAL "")
SET_TESTS_PROPERTIES (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test})
@@ -177,6 +226,7 @@ IF (BUILD_TESTING)
# Test when h5stat a file that does not exist
ADD_H5_TEST (h5stat_notexist 1 notexist.h5)
+ ADD_H5_TEST (h5stat_nofile 1 '')
# Test file with groups, compressed datasets, user-applied fileters, etc.
# h5stat_filters.h5 is a copy of ../../testfiles/tfilters.h5 as of release 1.8.0-alpha4
@@ -195,6 +245,47 @@ IF (BUILD_TESTING)
ADD_H5_TEST (h5stat_newgrat 0 h5stat_newgrat.h5)
ADD_H5_TEST (h5stat_newgrat-UG 0 -G h5stat_newgrat.h5)
ADD_H5_TEST (h5stat_newgrat-UA 0 -A h5stat_newgrat.h5)
+#
+# Tests for -l (--links) option on h5stat_threshold.h5:
+# -l 0 (incorrect threshold value)
+# -g -l 8
+# --links=8
+# --links=20 -g
+ ADD_H5_TEST (h5stat_err1_links 1 -l 0 h5stat_threshold.h5)
+ ADD_H5_TEST (h5stat_links1 0 -g -l 8 h5stat_threshold.h5)
+ ADD_H5_TEST (h5stat_links2 0 --links=8 h5stat_threshold.h5)
+ ADD_H5_TEST (h5stat_links3 0 --links=20 -g h5stat_threshold.h5)
+#
+# Tests for -l (--links) option on h5stat_newgrat.h5:
+# -g
+# -g -l 40000
+ ADD_H5_TEST (h5stat_links4 0 -g h5stat_newgrat.h5)
+ ADD_H5_TEST (h5stat_links5 0 -g -l 40000 h5stat_newgrat.h5)
+#
+# Tests for -m (--dims) option on h5stat_threshold.h5
+# -d --dims=-1 (incorrect threshold value)
+# -gd -m 5
+# -d --di=15
+ ADD_H5_TEST (h5stat_err1_dims 1 -d --dims=-1 h5stat_threshold.h5)
+ ADD_H5_TEST (h5stat_dims1 0 -gd -m 5 h5stat_threshold.h5)
+ ADD_H5_TEST (h5stat_dims2 0 -d --di=15 h5stat_threshold.h5)
+#
+# Tests for -a option on h5stat_threshold.h5
+# -a -2 (incorrect threshold value)
+# --numattrs (without threshold value)
+# -AS -a 10
+# -a 1
+# -A --numattrs=25
+ ADD_H5_TEST (h5stat_err1_numattrs 1 -a -2 h5stat_threshold.h5)
+ ADD_H5_TEST (h5stat_err2_numattrs 1 --numattrs h5stat_threshold.h5)
+ ADD_H5_TEST (h5stat_numattrs1 0 -AS -a 10 h5stat_threshold.h5)
+ ADD_H5_TEST (h5stat_numattrs2 0 -a 1 h5stat_threshold.h5)
+ ADD_H5_TEST (h5stat_numattrs3 0 -A --numattrs=25 h5stat_threshold.h5)
+#
+# Tests for -a option on h5stat_newgrat.h5
+# -A -a 100
+ ADD_H5_TEST (h5stat_numattrs4 0 -A -a 100 h5stat_newgrat.h5)
+#
ENDIF (BUILD_TESTING)
##############################################################################
diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt
index 4367cb5..2a59a32 100644
--- a/tools/testfiles/h5dump-help.txt
+++ b/tools/testfiles/h5dump-help.txt
@@ -21,6 +21,8 @@ usage: h5dump [OPTIONS] files
-g P, --group=P Print the specified group and all members
-l P, --soft-link=P Print the value(s) of the specified soft link
-t P, --datatype=P Print the specified named datatype
+ -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P
+ P can be the absolute path or just a relative path.
-A, --onlyattr Print the header and value of attributes
Optional value 0 suppresses printing attributes.
--------------- Object Property Options ---------------
diff --git a/tools/testfiles/tall-7.ddl b/tools/testfiles/tall-7.ddl
new file mode 100644
index 0000000..f0ad5ea
--- /dev/null
+++ b/tools/testfiles/tall-7.ddl
@@ -0,0 +1,9 @@
+HDF5 "tall.h5" {
+ATTRIBUTE "attr1" {
+ DATATYPE H5T_STD_I8BE
+ DATASPACE SIMPLE { ( 10 ) / ( 10 ) }
+ DATA {
+ (0): 97, 98, 99, 100, 101, 102, 103, 104, 105, 0
+ }
+}
+}
diff --git a/tools/testfiles/tall-7N.ddl b/tools/testfiles/tall-7N.ddl
new file mode 100644
index 0000000..cba5774
--- /dev/null
+++ b/tools/testfiles/tall-7N.ddl
@@ -0,0 +1,17 @@
+HDF5 "tall.h5" {
+ATTRIBUTE "attr1" {
+ DATATYPE H5T_STD_I8BE
+ DATASPACE SIMPLE { ( 10 ) / ( 10 ) }
+ DATA {
+ (0): 97, 98, 99, 100, 101, 102, 103, 104, 105, 0
+ }
+}
+ATTRIBUTE "attr1" {
+ DATATYPE H5T_STD_I8BE
+ DATASPACE SIMPLE { ( 27 ) / ( 27 ) }
+ DATA {
+ (0): 49, 115, 116, 32, 97, 116, 116, 114, 105, 98, 117, 116, 101, 32, 111,
+ (15): 102, 32, 100, 115, 101, 116, 49, 46, 49, 46, 49, 0
+ }
+}
+}
diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/tnofilename-with-packed-bits.ddl
index e22cd82..1ad1249 100644
--- a/tools/testfiles/tnofilename-with-packed-bits.ddl
+++ b/tools/testfiles/tnofilename-with-packed-bits.ddl
@@ -21,6 +21,8 @@ usage: h5dump [OPTIONS] files
-g P, --group=P Print the specified group and all members
-l P, --soft-link=P Print the value(s) of the specified soft link
-t P, --datatype=P Print the specified named datatype
+ -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P
+ P can be the absolute path or just a relative path.
-A, --onlyattr Print the header and value of attributes
Optional value 0 suppresses printing attributes.
--------------- Object Property Options ---------------
diff --git a/tools/testfiles/tpbitsIncomplete.ddl b/tools/testfiles/tpbitsIncomplete.ddl
index a7e1d02..1468ad1 100644
--- a/tools/testfiles/tpbitsIncomplete.ddl
+++ b/tools/testfiles/tpbitsIncomplete.ddl
@@ -21,6 +21,8 @@ usage: h5dump [OPTIONS] files
-g P, --group=P Print the specified group and all members
-l P, --soft-link=P Print the value(s) of the specified soft link
-t P, --datatype=P Print the specified named datatype
+ -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P
+ P can be the absolute path or just a relative path.
-A, --onlyattr Print the header and value of attributes
Optional value 0 suppresses printing attributes.
--------------- Object Property Options ---------------
diff --git a/tools/testfiles/tpbitsLengthExceeded.ddl b/tools/testfiles/tpbitsLengthExceeded.ddl
index 62ca870..557f2a7 100644
--- a/tools/testfiles/tpbitsLengthExceeded.ddl
+++ b/tools/testfiles/tpbitsLengthExceeded.ddl
@@ -21,6 +21,8 @@ usage: h5dump [OPTIONS] files
-g P, --group=P Print the specified group and all members
-l P, --soft-link=P Print the value(s) of the specified soft link
-t P, --datatype=P Print the specified named datatype
+ -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P
+ P can be the absolute path or just a relative path.
-A, --onlyattr Print the header and value of attributes
Optional value 0 suppresses printing attributes.
--------------- Object Property Options ---------------
diff --git a/tools/testfiles/tpbitsLengthPositive.ddl b/tools/testfiles/tpbitsLengthPositive.ddl
index 2a69f14..342e4e8 100644
--- a/tools/testfiles/tpbitsLengthPositive.ddl
+++ b/tools/testfiles/tpbitsLengthPositive.ddl
@@ -21,6 +21,8 @@ usage: h5dump [OPTIONS] files
-g P, --group=P Print the specified group and all members
-l P, --soft-link=P Print the value(s) of the specified soft link
-t P, --datatype=P Print the specified named datatype
+ -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P
+ P can be the absolute path or just a relative path.
-A, --onlyattr Print the header and value of attributes
Optional value 0 suppresses printing attributes.
--------------- Object Property Options ---------------
diff --git a/tools/testfiles/tpbitsMaxExceeded.ddl b/tools/testfiles/tpbitsMaxExceeded.ddl
index aafdd91..eb569d2 100644
--- a/tools/testfiles/tpbitsMaxExceeded.ddl
+++ b/tools/testfiles/tpbitsMaxExceeded.ddl
@@ -21,6 +21,8 @@ usage: h5dump [OPTIONS] files
-g P, --group=P Print the specified group and all members
-l P, --soft-link=P Print the value(s) of the specified soft link
-t P, --datatype=P Print the specified named datatype
+ -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P
+ P can be the absolute path or just a relative path.
-A, --onlyattr Print the header and value of attributes
Optional value 0 suppresses printing attributes.
--------------- Object Property Options ---------------
diff --git a/tools/testfiles/tpbitsOffsetExceeded.ddl b/tools/testfiles/tpbitsOffsetExceeded.ddl
index 960f62b..a00b561 100644
--- a/tools/testfiles/tpbitsOffsetExceeded.ddl
+++ b/tools/testfiles/tpbitsOffsetExceeded.ddl
@@ -21,6 +21,8 @@ usage: h5dump [OPTIONS] files
-g P, --group=P Print the specified group and all members
-l P, --soft-link=P Print the value(s) of the specified soft link
-t P, --datatype=P Print the specified named datatype
+ -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P
+ P can be the absolute path or just a relative path.
-A, --onlyattr Print the header and value of attributes
Optional value 0 suppresses printing attributes.
--------------- Object Property Options ---------------
diff --git a/tools/testfiles/tpbitsOffsetNegative.ddl b/tools/testfiles/tpbitsOffsetNegative.ddl
index c113866..aa6e79b 100644
--- a/tools/testfiles/tpbitsOffsetNegative.ddl
+++ b/tools/testfiles/tpbitsOffsetNegative.ddl
@@ -21,6 +21,8 @@ usage: h5dump [OPTIONS] files
-g P, --group=P Print the specified group and all members
-l P, --soft-link=P Print the value(s) of the specified soft link
-t P, --datatype=P Print the specified named datatype
+ -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P
+ P can be the absolute path or just a relative path.
-A, --onlyattr Print the header and value of attributes
Optional value 0 suppresses printing attributes.
--------------- Object Property Options ---------------