summaryrefslogtreecommitdiffstats
path: root/tools/test/h5stat
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2016-10-27 15:06:00 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2016-10-27 15:06:00 (GMT)
commit2c6dbbf2129c4997606be4b130346d42fe12eae3 (patch)
treedb8430aa5757b32f3bd46928798cc2b686a72bfb /tools/test/h5stat
parent5b562d9ce9b2945d0378b9c03e01f42923da80f4 (diff)
downloadhdf5-2c6dbbf2129c4997606be4b130346d42fe12eae3.zip
hdf5-2c6dbbf2129c4997606be4b130346d42fe12eae3.tar.gz
hdf5-2c6dbbf2129c4997606be4b130346d42fe12eae3.tar.bz2
Split tools into src and test - add folders
Diffstat (limited to 'tools/test/h5stat')
-rw-r--r--tools/test/h5stat/CMakeLists.txt22
-rw-r--r--tools/test/h5stat/CMakeTests.cmake237
-rw-r--r--tools/test/h5stat/Makefile.am48
-rw-r--r--tools/test/h5stat/h5stat_gentest.c449
-rw-r--r--tools/test/h5stat/testfiles/h5stat_dims1.ddl45
-rw-r--r--tools/test/h5stat/testfiles/h5stat_dims2.ddl36
-rw-r--r--tools/test/h5stat/testfiles/h5stat_err1_dims.ddl1
-rw-r--r--tools/test/h5stat/testfiles/h5stat_err1_links.ddl1
-rw-r--r--tools/test/h5stat/testfiles/h5stat_err1_numattrs.ddl1
-rw-r--r--tools/test/h5stat/testfiles/h5stat_err2_numattrs.ddl1
-rw-r--r--tools/test/h5stat/testfiles/h5stat_filters-F.ddl26
-rw-r--r--tools/test/h5stat/testfiles/h5stat_filters-UD.ddl5
-rw-r--r--tools/test/h5stat/testfiles/h5stat_filters-UT.ddl10
-rw-r--r--tools/test/h5stat/testfiles/h5stat_filters-d.ddl32
-rw-r--r--tools/test/h5stat/testfiles/h5stat_filters-dT.ddl41
-rw-r--r--tools/test/h5stat/testfiles/h5stat_filters-file.ddl9
-rw-r--r--tools/test/h5stat/testfiles/h5stat_filters-g.ddl6
-rw-r--r--tools/test/h5stat/testfiles/h5stat_filters.ddl97
-rw-r--r--tools/test/h5stat/testfiles/h5stat_filters.h5bin0 -> 46272 bytes
-rw-r--r--tools/test/h5stat/testfiles/h5stat_help1.ddl24
-rw-r--r--tools/test/h5stat/testfiles/h5stat_help2.ddl24
-rw-r--r--tools/test/h5stat/testfiles/h5stat_idx.ddl93
-rw-r--r--tools/test/h5stat/testfiles/h5stat_idx.h5bin0 -> 2206 bytes
-rw-r--r--tools/test/h5stat/testfiles/h5stat_links1.ddl10
-rw-r--r--tools/test/h5stat/testfiles/h5stat_links2.ddl105
-rw-r--r--tools/test/h5stat/testfiles/h5stat_links3.ddl12
-rw-r--r--tools/test/h5stat/testfiles/h5stat_links4.ddl8
-rw-r--r--tools/test/h5stat/testfiles/h5stat_links5.ddl9
-rw-r--r--tools/test/h5stat/testfiles/h5stat_newgrat-UA.ddl7
-rw-r--r--tools/test/h5stat/testfiles/h5stat_newgrat-UG.ddl5
-rw-r--r--tools/test/h5stat/testfiles/h5stat_newgrat.ddl95
-rw-r--r--tools/test/h5stat/testfiles/h5stat_newgrat.h5bin0 -> 6362168 bytes
-rw-r--r--tools/test/h5stat/testfiles/h5stat_nofile.ddl25
-rw-r--r--tools/test/h5stat/testfiles/h5stat_notexist.ddl2
-rw-r--r--tools/test/h5stat/testfiles/h5stat_numattrs1.ddl17
-rw-r--r--tools/test/h5stat/testfiles/h5stat_numattrs2.ddl105
-rw-r--r--tools/test/h5stat/testfiles/h5stat_numattrs3.ddl12
-rw-r--r--tools/test/h5stat/testfiles/h5stat_numattrs4.ddl8
-rw-r--r--tools/test/h5stat/testfiles/h5stat_threshold.h5bin0 -> 16312 bytes
-rw-r--r--tools/test/h5stat/testfiles/h5stat_tsohm.ddl90
-rw-r--r--tools/test/h5stat/testfiles/h5stat_tsohm.h5bin0 -> 3850 bytes
-rw-r--r--tools/test/h5stat/testh5stat.sh.in318
42 files changed, 2036 insertions, 0 deletions
diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt
new file mode 100644
index 0000000..98cfed7
--- /dev/null
+++ b/tools/test/h5stat/CMakeLists.txt
@@ -0,0 +1,22 @@
+cmake_minimum_required (VERSION 3.1.0)
+PROJECT (HDF5_TOOLS_TEST_H5STAT)
+
+#-----------------------------------------------------------------------------
+# Setup include Directories
+#-----------------------------------------------------------------------------
+INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib)
+
+ # --------------------------------------------------------------------
+ # Add the h5stat test executables
+ # --------------------------------------------------------------------
+ if (HDF5_BUILD_GENERATORS)
+ add_executable (h5stat_gentest ${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/h5stat_gentest.c)
+ TARGET_NAMING (h5stat_gentest STATIC)
+ TARGET_C_PROPERTIES (h5stat_gentest STATIC " " " ")
+ target_link_libraries (h5stat_gentest ${HDF5_LIB_TARGET})
+ set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools)
+
+ #add_test (NAME h5stat_gentest COMMAND $<TARGET_FILE:h5stat_gentest>)
+ endif (HDF5_BUILD_GENERATORS)
+
+ include (CMakeTests.cmake)
diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake
new file mode 100644
index 0000000..201e978
--- /dev/null
+++ b/tools/test/h5stat/CMakeTests.cmake
@@ -0,0 +1,237 @@
+
+##############################################################################
+##############################################################################
+### T E S T I N G ###
+##############################################################################
+##############################################################################
+
+ # --------------------------------------------------------------------
+ # Copy all the HDF5 files from the test directory into the source directory
+ # --------------------------------------------------------------------
+ set (HDF5_REFERENCE_FILES
+ h5stat_help1.ddl
+ h5stat_help2.ddl
+ h5stat_notexist.ddl
+ h5stat_nofile.ddl
+ h5stat_filters.ddl
+ h5stat_filters-file.ddl
+ h5stat_filters-F.ddl
+ h5stat_filters-d.ddl
+ h5stat_filters-g.ddl
+ h5stat_filters-dT.ddl
+ h5stat_filters-UD.ddl
+ h5stat_filters-UT.ddl
+ h5stat_tsohm.ddl
+ 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})
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/testfiles/${ddl_file}" "${PROJECT_BINARY_DIR}/${ddl_file}" "h5stat_files")
+ endforeach (ddl_file ${HDF5_REFERENCE_FILES})
+
+ foreach (h5_file ${HDF5_REFERENCE_TEST_FILES})
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "h5stat_files")
+ endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES})
+ add_custom_target(h5stat_files ALL COMMENT "Copying files needed by h5stat tests" DEPENDS ${h5stat_files_list})
+
+##############################################################################
+##############################################################################
+### T H E T E S T S M A C R O S ###
+##############################################################################
+##############################################################################
+
+ MACRO (ADD_H5_TEST resultfile resultcode)
+ # If using memchecker add tests without using scripts
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5STAT-${resultfile} COMMAND $<TARGET_FILE:h5stat> ${ARGN})
+ if (NOT ${resultcode} STREQUAL "0")
+ set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true")
+ endif (NOT ${resultcode} STREQUAL "0")
+ if (NOT "${last_test}" STREQUAL "")
+ set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test})
+ endif (NOT "${last_test}" STREQUAL "")
+ else (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (
+ NAME H5STAT-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5stat>"
+ -D "TEST_ARGS=${ARGN}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -D "TEST_OUTPUT=${resultfile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}.ddl"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif (HDF5_ENABLE_USING_MEMCHECKER)
+ ENDMACRO (ADD_H5_TEST file)
+
+##############################################################################
+##############################################################################
+### T H E T E S T S ###
+##############################################################################
+##############################################################################
+
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ # Remove any output file left over from previous test run
+ add_test (
+ NAME H5STAT-clearall-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ h5stat_help1.out
+ h5stat_help1.out.err
+ h5stat_help2.out
+ 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
+ h5stat_filters-file.out.err
+ h5stat_filters-F.out
+ h5stat_filters-F.out.err
+ h5stat_filters-d.out
+ h5stat_filters-d.out.err
+ h5stat_filters-g.out
+ h5stat_filters-g.out.err
+ h5stat_filters-dT.out
+ h5stat_filters-dT.out.err
+ h5stat_filters-UD.out
+ h5stat_filters-UD.out.err
+ h5stat_filters-UT.out
+ h5stat_filters-UT.out.err
+ h5stat_tsohm.out
+ h5stat_tsohm.out.err
+ h5stat_newgrat.out
+ h5stat_newgrat.out.err
+ h5stat_newgrat-UG.out
+ 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})
+ endif (NOT "${last_test}" STREQUAL "")
+ set (last_test "H5STAT-clearall-objects")
+ endif (HDF5_ENABLE_USING_MEMCHECKER)
+
+# Test for help flag
+ ADD_H5_TEST (h5stat_help1 0 -h)
+ ADD_H5_TEST (h5stat_help2 0 --help)
+
+# 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
+ ADD_H5_TEST (h5stat_filters 0 h5stat_filters.h5)
+ ADD_H5_TEST (h5stat_filters-file 0 -f h5stat_filters.h5)
+ ADD_H5_TEST (h5stat_filters-F 0 -F h5stat_filters.h5)
+ ADD_H5_TEST (h5stat_filters-d 0 -d h5stat_filters.h5)
+ ADD_H5_TEST (h5stat_filters-g 0 -g h5stat_filters.h5)
+ ADD_H5_TEST (h5stat_filters-dT 0 -dT h5stat_filters.h5)
+ ADD_H5_TEST (h5stat_filters-UD 0 -D h5stat_filters.h5)
+ ADD_H5_TEST (h5stat_filters-UT 0 -T h5stat_filters.h5)
+# h5stat_tsohm.h5 is a copy of ../../../test/tsohm.h5 generated by tsohm.c
+# as of release 1.8.7-snap0 (on a 64-bit machine)
+ ADD_H5_TEST (h5stat_tsohm 0 h5stat_tsohm.h5)
+# h5stat_newgrat.h5 is generated by h5stat_gentest.c
+ 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)
+#
diff --git a/tools/test/h5stat/Makefile.am b/tools/test/h5stat/Makefile.am
new file mode 100644
index 0000000..630e896
--- /dev/null
+++ b/tools/test/h5stat/Makefile.am
@@ -0,0 +1,48 @@
+#
+# 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.
+##
+## Makefile.am
+## Run automake to generate a Makefile.in from this file.
+#
+# HDF5 Library Makefile(.in)
+#
+
+include $(top_srcdir)/config/commence.am
+
+# Include src directory
+AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib
+
+#test script and program
+TEST_PROG=h5stat_gentest
+TEST_SCRIPT=testh5stat.sh
+
+check_PROGRAMS=$(TEST_PROG)
+check_SCRIPTS=$(TEST_SCRIPT)
+SCRIPT_DEPEND=../../src/h5stat/h5stat$(EXEEXT)
+
+# Tell automake to clean h5redeploy script
+CLEANFILES=
+
+# Temporary files. *.h5 are generated by h5repart_gentest. They should
+# copied to the testfiles/ directory if update is required. fst_family*.h5
+# and scd_family*.h5 were created by setting the HDF5_NOCLEANUP variable.
+CHECK_CLEANFILES+=*.h5 ../testfiles/fst_family*.h5 ../testfiles/scd_family*.h5
+
+# These were generated by configure. Remove them only when distclean.
+DISTCLEANFILES=testh5stat.sh
+
+# All programs rely on hdf5 library and h5tools library
+LDADD=$(LIBH5TOOLS) $(LIBHDF5)
+
+include $(top_srcdir)/config/conclude.am
diff --git a/tools/test/h5stat/h5stat_gentest.c b/tools/test/h5stat/h5stat_gentest.c
new file mode 100644
index 0000000..b1ab168
--- /dev/null
+++ b/tools/test/h5stat/h5stat_gentest.c
@@ -0,0 +1,449 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Generate the binary hdf5 files for the h5stat tests.
+ * Usage: just execute the program without any arguments will
+ * generate all the binary hdf5 files
+ *
+ * If you regenerate the test files (e.g., changing some code,
+ * trying it on a new platform, ...), you need to verify the correctness
+ * of the expected output and update the corresponding *.ddl files.
+ */
+#include "hdf5.h"
+
+/* For gen_newgrat_file() */
+#define NEWGRAT_FILE "h5stat_newgrat.h5"
+#define DATASET_NAME "DATASET_NAME"
+#define GROUP_NAME "GROUP"
+#define ATTR_NAME "ATTR"
+#define NUM_GRPS 35000
+#define NUM_ATTRS 100
+
+/* Declarations for gen_idx_file() */
+#define IDX_FILE "h5stat_idx.h5"
+#define DSET "dset"
+#define DSET_FILTER "dset_filter"
+
+/* For gen_threshold_file() */
+#define THRESHOLD_FILE "h5stat_threshold.h5"
+#define THRES_ATTR_NAME "attr"
+#define THRES_ATTR_GRP_NAME "grp_attr"
+#define THRES_DSET_NAME "dset"
+#define THRES_NUM 10
+#define THRES_NUM_25 25
+
+/*
+ * Generate HDF5 file with latest format with
+ * NUM_GRPS groups and NUM_ATTRS attributes for the dataset
+ */
+static void
+gen_newgrat_file(const char *fname)
+{
+ hid_t fcpl = -1; /* File creation property */
+ hid_t fapl = -1; /* File access property */
+ hid_t fid = -1; /* File id */
+ hid_t gid = -1; /* Group id */
+ hid_t tid = -1; /* Datatype id */
+ hid_t sid = -1; /* Dataspace id */
+ hid_t attr_id = -1; /* Attribute id */
+ hid_t did = -1; /* Dataset id */
+ char name[30]; /* Group name */
+ char attrname[30]; /* Attribute name */
+ int i; /* Local index variable */
+
+ /* Get a copy file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ goto error;
+
+ /* Set to use latest library format */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ goto error;
+
+ /* Get a copy of file creation property list */
+ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
+ goto error;
+
+ /* Set file space handling strategy */
+ if(H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0) < 0)
+ goto error;
+
+ /* Create file */
+ if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
+ goto error;
+
+ /* Create NUM_GRPS groups in the root group */
+ for(i = 1; i <= NUM_GRPS; i++) {
+ sprintf(name, "%s%d", GROUP_NAME,i);
+ if((gid = H5Gcreate2(fid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if(H5Gclose(gid) < 0)
+ goto error;
+ } /* end for */
+
+ /* Create a datatype to commit and use */
+ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)
+ goto error;
+
+ /* Create dataspace for dataset */
+ if((sid = H5Screate(H5S_SCALAR)) < 0)
+ goto error;
+
+ /* Create dataset */
+ if((did = H5Dcreate2(fid, DATASET_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Create NUM_ATTRS for the dataset */
+ for(i = 1; i <= NUM_ATTRS; i++) {
+ sprintf(attrname, "%s%d", ATTR_NAME,i);
+ if((attr_id = H5Acreate2(did, attrname, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if(H5Aclose(attr_id) < 0)
+ goto error;
+ } /* end for */
+
+ /* Close dataset, dataspace, datatype, file */
+ if(H5Pclose(fapl) < 0)
+ goto error;
+ if(H5Pclose(fcpl) < 0)
+ goto error;
+ if(H5Dclose(did) < 0)
+ goto error;
+ if(H5Sclose(sid) < 0)
+ goto error;
+ if(H5Tclose(tid) < 0)
+ goto error;
+ if(H5Fclose(fid) < 0)
+ goto error;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(fapl);
+ H5Pclose(fcpl);
+ H5Aclose(attr_id);
+ H5Dclose(did);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Gclose(gid);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+} /* gen_newgrat_file() */
+
+/*
+ * Generate an HDF5 file with groups, datasets, attributes for testing the options:
+ * -l N (--links=N): Set the threshold for # of links when printing information for small groups.
+ * -m N (--dims=N): Set the threshold for the # of dimension sizes when printing information for small datasets.
+ * -a N (--numattrs=N): Set the threshold for the # of attributes when printing information for small # of attributes.
+ */
+static void
+gen_threshold_file(const char *fname)
+{
+ hid_t fid; /* File ID */
+ hid_t sid0, sid1, sid2, sid3, sid4; /* Dataspace IDs */
+ hid_t did; /* Dataset ID */
+ hid_t attr_id; /* Attribute ID */
+ hid_t gid; /* Group ID */
+ hsize_t two_dims[] = {2, 5}; /* Dimension array */
+ hsize_t one_dims[] = {6}; /* Dimension array */
+ hsize_t zero_dims[] = {0}; /* Dimension array */
+ char name[30]; /* Name */
+ unsigned i; /* Local index variable */
+
+ /* Create file */
+ if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Create 1-D dataspace with zero dimension size */
+ if((sid0 = H5Screate_simple(1, zero_dims, NULL)) < 0)
+ goto error;
+
+ /* Create 1-D dataspace with non-zero dimension size*/
+ if((sid1 = H5Screate_simple(1, one_dims, NULL)) < 0)
+ goto error;
+
+ /* Create 2-D dataspace */
+ if((sid2 = H5Screate_simple(2, two_dims, NULL)) < 0)
+ goto error;
+
+ /* Create scalar dataspace */
+ if((sid3 = H5Screate(H5S_SCALAR)) < 0)
+ goto error;
+
+ /* Create null dataspace */
+ if((sid4 = H5Screate(H5S_NULL)) < 0)
+ goto error;
+
+ /* Create an attribute for the root group */
+ if((attr_id = H5Acreate2(fid, "attr", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if(H5Aclose(attr_id) < 0)
+ goto error;
+
+ /* Create 1-D dataset with zero dimension size for the root group */
+ if((did = H5Dcreate2(fid, "zero_dset", H5T_NATIVE_UCHAR, sid0, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Create 11 attributes for the dataset */
+ for(i = 1; i <= (THRES_NUM+1); i++) {
+ sprintf(name, "%s%d", THRES_ATTR_NAME,i);
+ if((attr_id = H5Acreate2(did, name, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if(H5Aclose(attr_id) < 0)
+ goto error;
+ }
+ if(H5Dclose(did) < 0)
+ goto error;
+
+ /* Create dataset with scalar dataspace for the root group */
+ if((did = H5Dcreate2(fid, "scalar_dset", H5T_NATIVE_UCHAR, sid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if(H5Dclose(did) < 0)
+ goto error;
+
+ /* Create dataset with null dataspace for the root group */
+ if((did = H5Dcreate2(fid, "null_dset", H5T_NATIVE_UCHAR, sid4, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if(H5Dclose(did) < 0)
+ goto error;
+
+ /* Create 2-D dataset for the root group */
+ if((did = H5Dcreate2(fid, "dset", H5T_NATIVE_UCHAR, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Create 10 attributes for the 2-D dataset */
+ for(i = 1; i <= THRES_NUM; i++) {
+ sprintf(name, "%s%d", THRES_ATTR_NAME,i);
+ if((attr_id = H5Acreate2(did, name, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if(H5Aclose(attr_id) < 0)
+ goto error;
+ }
+ if(H5Dclose(did) < 0)
+ goto error;
+
+ /* Create first group */
+ if((gid = H5Gcreate2(fid, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Create an attribute for the group */
+ if((attr_id = H5Acreate2(gid, "ATTR", H5T_NATIVE_INT, sid3, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Close attribute */
+ if(H5Aclose(attr_id) < 0)
+ goto error;
+
+ /* Create 10 1-D datasets with non-zero dimension size for the group */
+ for(i = 1; i <= THRES_NUM; i++) {
+ /* set up dataset name */
+ sprintf(name, "%s%d", THRES_DSET_NAME,i);
+
+ /* Create the dataset */
+ if((did = H5Dcreate2(gid, name, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Close the dataset */
+ if(H5Dclose(did) < 0)
+ goto error;
+ }
+
+ /* Close the group */
+ if(H5Gclose(gid) < 0)
+ goto error;
+
+
+ /* Create second group */
+ if((gid = H5Gcreate2(fid, "group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Create 25 attributes for the group */
+ for(i = 1; i <= THRES_NUM_25; i++) {
+ /* Set up attribute name */
+ sprintf(name, "%s%d", THRES_ATTR_GRP_NAME,i);
+
+ /* Create the attribute */
+ if((attr_id = H5Acreate2(gid, name, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Close the attribute */
+ if(H5Aclose(attr_id) < 0)
+ goto error;
+ }
+
+ /* Close the group */
+ if(H5Gclose(gid) < 0)
+ goto error;
+
+ /* Create third group */
+ if((gid = H5Gcreate2(fid, "group3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Create 9 1-D datasets with non-zero dimension size for the group */
+ for(i = 1; i < THRES_NUM; i++) {
+ /* set up dataset name */
+ sprintf(name, "%s%d", THRES_DSET_NAME,i);
+
+ /* Create the dataset */
+ if((did = H5Dcreate2(gid, name, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Close the dataset */
+ if(H5Dclose(did) < 0)
+ goto error;
+ }
+
+ /* Close the group */
+ if(H5Gclose(gid) < 0)
+ goto error;
+
+
+ /* Close dataspaces */
+ if(H5Sclose(sid0) < 0)
+ goto error;
+ if(H5Sclose(sid1) < 0)
+ goto error;
+ if(H5Sclose(sid2) < 0)
+ goto error;
+ if(H5Sclose(sid3) < 0)
+ goto error;
+ if(H5Sclose(sid4) < 0)
+ goto error;
+
+ /* Close file */
+ if(H5Fclose(fid) < 0)
+ goto error;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Gclose(gid);
+ H5Aclose(attr_id);
+ H5Dclose(did);
+ H5Sclose(sid0);
+ H5Sclose(sid1);
+ H5Sclose(sid2);
+ H5Sclose(sid3);
+ H5Sclose(sid4);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+
+} /* gen_threshold_file() */
+
+/*
+ * Function: gen_idx_file
+ *
+ * Purpose: Create a file with datasets that use Fixed Array indexing:
+ * one dataset: fixed dimension, chunked layout, w/o filters
+ * one dataset: fixed dimension, chunked layout, w/ filters
+ *
+ */
+static void
+gen_idx_file(const char *fname)
+{
+ hid_t fapl = -1; /* file access property id */
+ hid_t fid = -1; /* file id */
+ hid_t sid = -1; /* space id */
+ hid_t dcpl = -1; /* dataset creation property id */
+ hid_t did = -1, did2 = -1; /* dataset id */
+ hsize_t dims[1] = {10}; /* dataset dimension */
+ hsize_t c_dims[1] = {2}; /* chunk dimension */
+ int i; /* local index variable */
+ int buf[10]; /* data buffer */
+
+ /* Get a copy of the file access property */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ goto error;
+
+ /* Set the "use the latest format" bounds for creating objects in the file */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ goto error;
+
+ /* Create file */
+ if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ goto error;
+
+ /* Create data */
+ for(i = 0; i < 10; i++)
+ buf[i] = i;
+
+ /* Set chunk */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+
+ if(H5Pset_chunk(dcpl, 1, c_dims) < 0)
+ goto error;
+
+ /* Create a 1D dataset */
+ if((sid = H5Screate_simple(1, dims, NULL)) < 0)
+ goto error;
+ if((did = H5Dcreate2(fid, DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Write to the dataset */
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ goto error;
+
+#if defined (H5_HAVE_FILTER_DEFLATE)
+ /* set deflate data */
+ if(H5Pset_deflate(dcpl, 9) < 0)
+ goto error;
+
+ /* Create and write the dataset */
+ if((did2 = H5Dcreate2(fid, DSET_FILTER, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ goto error;
+ if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ goto error;
+
+ /* Close the dataset */
+ if(H5Dclose(did2) < 0)
+ goto error;
+#endif
+
+ /* closing: dataspace, dataset, file */
+ if(H5Pclose(fapl) < 0)
+ goto error;
+ if(H5Pclose(dcpl) < 0)
+ goto error;
+ if(H5Sclose(sid) < 0)
+ goto error;
+ if(H5Dclose(did) < 0)
+ goto error;
+ if(H5Fclose(fid) < 0)
+ goto error;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(fapl);
+ H5Pclose(dcpl);
+ H5Sclose(sid);
+ H5Dclose(did);
+ H5Fclose(fid);
+#if defined (H5_HAVE_FILTER_DEFLATE)
+ H5Dclose(did2);
+#endif
+ } H5E_END_TRY;
+
+} /* gen_idx_file() */
+
+int main(void)
+{
+ gen_newgrat_file(NEWGRAT_FILE);
+ gen_threshold_file(THRESHOLD_FILE);
+
+ /* Generate an HDF file to test for datasets with Fixed Array indexing */
+ gen_idx_file(IDX_FILE);
+
+ return 0;
+}
+
diff --git a/tools/test/h5stat/testfiles/h5stat_dims1.ddl b/tools/test/h5stat/testfiles/h5stat_dims1.ddl
new file mode 100644
index 0000000..07b2900
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_dims1.ddl
@@ -0,0 +1,45 @@
+Filename: h5stat_threshold.h5
+Small groups (with 0 to 9 links):
+ # of groups with 0 link(s): 1
+ # of groups with 7 link(s): 1
+ # of groups with 9 link(s): 1
+ Total # of small groups: 3
+Group bins:
+ # of groups with 0 link: 1
+ # of groups with 1 - 9 links: 2
+ # of groups with 10 - 99 links: 1
+ Total # of groups: 4
+Dataset dimension information:
+ Max. rank of datasets: 2
+ Dataset ranks:
+ # of dataset with rank 0: 2
+ # of dataset with rank 1: 20
+ # of dataset with rank 2: 1
+1-D Dataset information:
+ Max. dimension size of 1-D datasets: 6
+ Small 1-D datasets (with dimension sizes 0 to 4):
+ # of datasets with dimension sizes 0: 1
+ Total # of small datasets: 1
+ 1-D Dataset dimension bins:
+ # of datasets with dimension size 0: 1
+ # of datasets with dimension size 1 - 9: 19
+ Total # of datasets: 20
+Dataset storage information:
+ Total raw data size: 0
+ Total external raw data size: 0
+Dataset layout information:
+ Dataset layout counts[COMPACT]: 0
+ Dataset layout counts[CONTIG]: 23
+ Dataset layout counts[CHUNKED]: 0
+ Dataset layout counts[VIRTUAL]: 0
+ Number of external files : 0
+Dataset filters information:
+ Number of datasets with:
+ NO filter: 23
+ GZIP filter: 0
+ SHUFFLE filter: 0
+ FLETCHER32 filter: 0
+ SZIP filter: 0
+ NBIT filter: 0
+ SCALEOFFSET filter: 0
+ USER-DEFINED filter: 0
diff --git a/tools/test/h5stat/testfiles/h5stat_dims2.ddl b/tools/test/h5stat/testfiles/h5stat_dims2.ddl
new file mode 100644
index 0000000..dbccd05
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_dims2.ddl
@@ -0,0 +1,36 @@
+Filename: h5stat_threshold.h5
+Dataset dimension information:
+ Max. rank of datasets: 2
+ Dataset ranks:
+ # of dataset with rank 0: 2
+ # of dataset with rank 1: 20
+ # of dataset with rank 2: 1
+1-D Dataset information:
+ Max. dimension size of 1-D datasets: 6
+ Small 1-D datasets (with dimension sizes 0 to 14):
+ # of datasets with dimension sizes 0: 1
+ # of datasets with dimension sizes 6: 19
+ Total # of small datasets: 20
+ 1-D Dataset dimension bins:
+ # of datasets with dimension size 0: 1
+ # of datasets with dimension size 1 - 9: 19
+ Total # of datasets: 20
+Dataset storage information:
+ Total raw data size: 0
+ Total external raw data size: 0
+Dataset layout information:
+ Dataset layout counts[COMPACT]: 0
+ Dataset layout counts[CONTIG]: 23
+ Dataset layout counts[CHUNKED]: 0
+ Dataset layout counts[VIRTUAL]: 0
+ Number of external files : 0
+Dataset filters information:
+ Number of datasets with:
+ NO filter: 23
+ GZIP filter: 0
+ SHUFFLE filter: 0
+ FLETCHER32 filter: 0
+ SZIP filter: 0
+ NBIT filter: 0
+ SCALEOFFSET filter: 0
+ USER-DEFINED filter: 0
diff --git a/tools/test/h5stat/testfiles/h5stat_err1_dims.ddl b/tools/test/h5stat/testfiles/h5stat_err1_dims.ddl
new file mode 100644
index 0000000..86d375b
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_err1_dims.ddl
@@ -0,0 +1 @@
+h5stat error: Invalid threshold for small datasets
diff --git a/tools/test/h5stat/testfiles/h5stat_err1_links.ddl b/tools/test/h5stat/testfiles/h5stat_err1_links.ddl
new file mode 100644
index 0000000..d43207c
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_err1_links.ddl
@@ -0,0 +1 @@
+h5stat error: Invalid threshold for small groups
diff --git a/tools/test/h5stat/testfiles/h5stat_err1_numattrs.ddl b/tools/test/h5stat/testfiles/h5stat_err1_numattrs.ddl
new file mode 100644
index 0000000..01b6c18
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_err1_numattrs.ddl
@@ -0,0 +1 @@
+h5stat error: Invalid threshold for small # of attributes
diff --git a/tools/test/h5stat/testfiles/h5stat_err2_numattrs.ddl b/tools/test/h5stat/testfiles/h5stat_err2_numattrs.ddl
new file mode 100644
index 0000000..01b6c18
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_err2_numattrs.ddl
@@ -0,0 +1 @@
+h5stat error: Invalid threshold for small # of attributes
diff --git a/tools/test/h5stat/testfiles/h5stat_filters-F.ddl b/tools/test/h5stat/testfiles/h5stat_filters-F.ddl
new file mode 100644
index 0000000..d44445b
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_filters-F.ddl
@@ -0,0 +1,26 @@
+Filename: h5stat_filters.h5
+File space information for file metadata (in bytes):
+ Superblock: 96
+ Superblock extension: 0
+ User block: 0
+ Object headers: (total/unused)
+ Groups: 48/8
+ Datasets(exclude compact data): 4136/1344
+ Datatypes: 80/0
+ Groups:
+ B-tree/List: 1200
+ Heap: 288
+ Attributes:
+ B-tree/List: 0
+ Heap: 0
+ Chunked datasets:
+ Index: 31392
+ Datasets:
+ Heap: 72
+ Shared Messages:
+ Header: 0
+ B-tree/List: 0
+ Heap: 0
+ Free-space managers:
+ Header: 0
+ Amount of free space: 0
diff --git a/tools/test/h5stat/testfiles/h5stat_filters-UD.ddl b/tools/test/h5stat/testfiles/h5stat_filters-UD.ddl
new file mode 100644
index 0000000..4efafd1
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_filters-UD.ddl
@@ -0,0 +1,5 @@
+Filename: h5stat_filters.h5
+File space information for datasets' metadata (in bytes):
+ Object headers (total/unused): 4136/1344
+ Index for Chunked datasets: 31392
+ Heap: 72
diff --git a/tools/test/h5stat/testfiles/h5stat_filters-UT.ddl b/tools/test/h5stat/testfiles/h5stat_filters-UT.ddl
new file mode 100644
index 0000000..d8de31f
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_filters-UT.ddl
@@ -0,0 +1,10 @@
+Filename: h5stat_filters.h5
+Dataset datatype information:
+ # of unique datatypes used by datasets: 2
+ Dataset datatype #0:
+ Count (total/named) = (14/0)
+ Size (desc./elmt) = (14/4)
+ Dataset datatype #1:
+ Count (total/named) = (1/0)
+ Size (desc./elmt) = (14/4)
+ Total dataset datatype count: 15
diff --git a/tools/test/h5stat/testfiles/h5stat_filters-d.ddl b/tools/test/h5stat/testfiles/h5stat_filters-d.ddl
new file mode 100644
index 0000000..6e6dd61
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_filters-d.ddl
@@ -0,0 +1,32 @@
+Filename: h5stat_filters.h5
+Dataset dimension information:
+ Max. rank of datasets: 2
+ Dataset ranks:
+ # of dataset with rank 1: 1
+ # of dataset with rank 2: 14
+1-D Dataset information:
+ Max. dimension size of 1-D datasets: 100
+ Small 1-D datasets (with dimension sizes 0 to 9):
+ Total # of small datasets: 0
+ 1-D Dataset dimension bins:
+ # of datasets with dimension size 100 - 999: 1
+ Total # of datasets: 1
+Dataset storage information:
+ Total raw data size: 8659
+ Total external raw data size: 400
+Dataset layout information:
+ Dataset layout counts[COMPACT]: 1
+ Dataset layout counts[CONTIG]: 2
+ Dataset layout counts[CHUNKED]: 12
+ Dataset layout counts[VIRTUAL]: 0
+ Number of external files : 2
+Dataset filters information:
+ Number of datasets with:
+ NO filter: 7
+ GZIP filter: 2
+ SHUFFLE filter: 2
+ FLETCHER32 filter: 2
+ SZIP filter: 2
+ NBIT filter: 2
+ SCALEOFFSET filter: 1
+ USER-DEFINED filter: 1
diff --git a/tools/test/h5stat/testfiles/h5stat_filters-dT.ddl b/tools/test/h5stat/testfiles/h5stat_filters-dT.ddl
new file mode 100644
index 0000000..b14ca9f
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_filters-dT.ddl
@@ -0,0 +1,41 @@
+Filename: h5stat_filters.h5
+Dataset dimension information:
+ Max. rank of datasets: 2
+ Dataset ranks:
+ # of dataset with rank 1: 1
+ # of dataset with rank 2: 14
+1-D Dataset information:
+ Max. dimension size of 1-D datasets: 100
+ Small 1-D datasets (with dimension sizes 0 to 9):
+ Total # of small datasets: 0
+ 1-D Dataset dimension bins:
+ # of datasets with dimension size 100 - 999: 1
+ Total # of datasets: 1
+Dataset storage information:
+ Total raw data size: 8659
+ Total external raw data size: 400
+Dataset layout information:
+ Dataset layout counts[COMPACT]: 1
+ Dataset layout counts[CONTIG]: 2
+ Dataset layout counts[CHUNKED]: 12
+ Dataset layout counts[VIRTUAL]: 0
+ Number of external files : 2
+Dataset filters information:
+ Number of datasets with:
+ NO filter: 7
+ GZIP filter: 2
+ SHUFFLE filter: 2
+ FLETCHER32 filter: 2
+ SZIP filter: 2
+ NBIT filter: 2
+ SCALEOFFSET filter: 1
+ USER-DEFINED filter: 1
+Dataset datatype information:
+ # of unique datatypes used by datasets: 2
+ Dataset datatype #0:
+ Count (total/named) = (14/0)
+ Size (desc./elmt) = (14/4)
+ Dataset datatype #1:
+ Count (total/named) = (1/0)
+ Size (desc./elmt) = (14/4)
+ Total dataset datatype count: 15
diff --git a/tools/test/h5stat/testfiles/h5stat_filters-file.ddl b/tools/test/h5stat/testfiles/h5stat_filters-file.ddl
new file mode 100644
index 0000000..5f7eff9
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_filters-file.ddl
@@ -0,0 +1,9 @@
+Filename: h5stat_filters.h5
+File information
+ # of unique groups: 1
+ # of unique datasets: 15
+ # of unique named datatypes: 1
+ # of unique links: 0
+ # of unique other: 0
+ Max. # of links to object: 1
+ Max. # of objects in group: 16
diff --git a/tools/test/h5stat/testfiles/h5stat_filters-g.ddl b/tools/test/h5stat/testfiles/h5stat_filters-g.ddl
new file mode 100644
index 0000000..290c82a
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_filters-g.ddl
@@ -0,0 +1,6 @@
+Filename: h5stat_filters.h5
+Small groups (with 0 to 9 links):
+ Total # of small groups: 0
+Group bins:
+ # of groups with 10 - 99 links: 1
+ Total # of groups: 1
diff --git a/tools/test/h5stat/testfiles/h5stat_filters.ddl b/tools/test/h5stat/testfiles/h5stat_filters.ddl
new file mode 100644
index 0000000..1a4fd72
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_filters.ddl
@@ -0,0 +1,97 @@
+Filename: h5stat_filters.h5
+File information
+ # of unique groups: 1
+ # of unique datasets: 15
+ # of unique named datatypes: 1
+ # of unique links: 0
+ # of unique other: 0
+ Max. # of links to object: 1
+ Max. # of objects in group: 16
+File space information for file metadata (in bytes):
+ Superblock: 96
+ Superblock extension: 0
+ User block: 0
+ Object headers: (total/unused)
+ Groups: 48/8
+ Datasets(exclude compact data): 4136/1344
+ Datatypes: 80/0
+ Groups:
+ B-tree/List: 1200
+ Heap: 288
+ Attributes:
+ B-tree/List: 0
+ Heap: 0
+ Chunked datasets:
+ Index: 31392
+ Datasets:
+ Heap: 72
+ Shared Messages:
+ Header: 0
+ B-tree/List: 0
+ Heap: 0
+ Free-space managers:
+ Header: 0
+ Amount of free space: 0
+Small groups (with 0 to 9 links):
+ Total # of small groups: 0
+Group bins:
+ # of groups with 10 - 99 links: 1
+ Total # of groups: 1
+Dataset dimension information:
+ Max. rank of datasets: 2
+ Dataset ranks:
+ # of dataset with rank 1: 1
+ # of dataset with rank 2: 14
+1-D Dataset information:
+ Max. dimension size of 1-D datasets: 100
+ Small 1-D datasets (with dimension sizes 0 to 9):
+ Total # of small datasets: 0
+ 1-D Dataset dimension bins:
+ # of datasets with dimension size 100 - 999: 1
+ Total # of datasets: 1
+Dataset storage information:
+ Total raw data size: 8659
+ Total external raw data size: 400
+Dataset layout information:
+ Dataset layout counts[COMPACT]: 1
+ Dataset layout counts[CONTIG]: 2
+ Dataset layout counts[CHUNKED]: 12
+ Dataset layout counts[VIRTUAL]: 0
+ Number of external files : 2
+Dataset filters information:
+ Number of datasets with:
+ NO filter: 7
+ GZIP filter: 2
+ SHUFFLE filter: 2
+ FLETCHER32 filter: 2
+ SZIP filter: 2
+ NBIT filter: 2
+ SCALEOFFSET filter: 1
+ USER-DEFINED filter: 1
+Dataset datatype information:
+ # of unique datatypes used by datasets: 2
+ Dataset datatype #0:
+ Count (total/named) = (14/0)
+ Size (desc./elmt) = (14/4)
+ Dataset datatype #1:
+ Count (total/named) = (1/0)
+ Size (desc./elmt) = (14/4)
+ Total dataset datatype count: 15
+Small # of attributes (objects with 1 to 10 attributes):
+ Total # of objects with small # of attributes: 0
+Attribute bins:
+ Total # of objects with attributes: 0
+ Max. # of attributes to objects: 0
+Free-space section threshold: 1 bytes
+Small size free-space sections (< 10 bytes):
+ Total # of small size sections: 0
+Free-space section bins:
+ Total # of sections: 0
+File space management strategy: H5F_FILE_SPACE_ALL
+Summary of file space information:
+ File metadata: 37312 bytes
+ Raw data: 8659 bytes
+ Amount/Percent of tracked free space: 0 bytes/0.0%
+ Unaccounted space: 301 bytes
+Total space: 46272 bytes
+External raw data: 400 bytes
diff --git a/tools/test/h5stat/testfiles/h5stat_filters.h5 b/tools/test/h5stat/testfiles/h5stat_filters.h5
new file mode 100644
index 0000000..5b5f4bb
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_filters.h5
Binary files differ
diff --git a/tools/test/h5stat/testfiles/h5stat_help1.ddl b/tools/test/h5stat/testfiles/h5stat_help1.ddl
new file mode 100644
index 0000000..d2a8715
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_help1.ddl
@@ -0,0 +1,24 @@
+Usage: h5stat [OPTIONS] file
+
+ OPTIONS
+ -h, --help Print a usage message and exit
+ -V, --version Print version number and exit
+ -f, --file Print file information
+ -F, --filemetadata Print file space information for file's metadata
+ -g, --group Print group information
+ -l N, --links=N Set the threshold for the # of links when printing
+ information for small groups. N is an integer greater
+ than 0. The default threshold is 10.
+ -G, --groupmetadata Print file space information for groups' metadata
+ -d, --dset Print dataset information
+ -m N, --dims=N Set the threshold for the dimension sizes when printing
+ information for small datasets. N is an integer greater
+ than 0. The default threshold is 10.
+ -D, --dsetmetadata Print file space information for datasets' metadata
+ -T, --dtypemetadata Print datasets' datatype information
+ -A, --attribute Print attribute information
+ -a N, --numattrs=N Set the threshold for the # of attributes when printing
+ information for small # of attributes. N is an integer greater
+ than 0. The default threshold is 10.
+ -s, --freespace Print free space information
+ -S, --summary Print summary of file space information
diff --git a/tools/test/h5stat/testfiles/h5stat_help2.ddl b/tools/test/h5stat/testfiles/h5stat_help2.ddl
new file mode 100644
index 0000000..d2a8715
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_help2.ddl
@@ -0,0 +1,24 @@
+Usage: h5stat [OPTIONS] file
+
+ OPTIONS
+ -h, --help Print a usage message and exit
+ -V, --version Print version number and exit
+ -f, --file Print file information
+ -F, --filemetadata Print file space information for file's metadata
+ -g, --group Print group information
+ -l N, --links=N Set the threshold for the # of links when printing
+ information for small groups. N is an integer greater
+ than 0. The default threshold is 10.
+ -G, --groupmetadata Print file space information for groups' metadata
+ -d, --dset Print dataset information
+ -m N, --dims=N Set the threshold for the dimension sizes when printing
+ information for small datasets. N is an integer greater
+ than 0. The default threshold is 10.
+ -D, --dsetmetadata Print file space information for datasets' metadata
+ -T, --dtypemetadata Print datasets' datatype information
+ -A, --attribute Print attribute information
+ -a N, --numattrs=N Set the threshold for the # of attributes when printing
+ information for small # of attributes. N is an integer greater
+ than 0. The default threshold is 10.
+ -s, --freespace Print free space information
+ -S, --summary Print summary of file space information
diff --git a/tools/test/h5stat/testfiles/h5stat_idx.ddl b/tools/test/h5stat/testfiles/h5stat_idx.ddl
new file mode 100644
index 0000000..b26f1a4
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_idx.ddl
@@ -0,0 +1,93 @@
+Filename: h5stat_idx.h5
+File information
+ # of unique groups: 1
+ # of unique datasets: 2
+ # of unique named datatypes: 0
+ # of unique links: 0
+ # of unique other: 0
+ Max. # of links to object: 1
+ Max. # of objects in group: 2
+File space information for file metadata (in bytes):
+ Superblock: 48
+ Superblock extension: 0
+ User block: 0
+ Object headers: (total/unused)
+ Groups: 147/47
+ Datasets(exclude compact data): 568/362
+ Datatypes: 0/0
+ Groups:
+ B-tree/List: 0
+ Heap: 0
+ Attributes:
+ B-tree/List: 0
+ Heap: 0
+ Chunked datasets:
+ Index: 202
+ Datasets:
+ Heap: 0
+ Shared Messages:
+ Header: 0
+ B-tree/List: 0
+ Heap: 0
+ Free-space managers:
+ Header: 0
+ Amount of free space: 0
+Small groups (with 0 to 9 links):
+ # of groups with 2 link(s): 1
+ Total # of small groups: 1
+Group bins:
+ # of groups with 1 - 9 links: 1
+ Total # of groups: 1
+Dataset dimension information:
+ Max. rank of datasets: 1
+ Dataset ranks:
+ # of dataset with rank 1: 2
+1-D Dataset information:
+ Max. dimension size of 1-D datasets: 10
+ Small 1-D datasets (with dimension sizes 0 to 9):
+ Total # of small datasets: 0
+ 1-D Dataset dimension bins:
+ # of datasets with dimension size 10 - 99: 2
+ Total # of datasets: 2
+Dataset storage information:
+ Total raw data size: 110
+ Total external raw data size: 0
+Dataset layout information:
+ Dataset layout counts[COMPACT]: 0
+ Dataset layout counts[CONTIG]: 0
+ Dataset layout counts[CHUNKED]: 2
+ Dataset layout counts[VIRTUAL]: 0
+ Number of external files : 0
+Dataset filters information:
+ Number of datasets with:
+ NO filter: 1
+ GZIP filter: 1
+ SHUFFLE filter: 0
+ FLETCHER32 filter: 0
+ SZIP filter: 0
+ NBIT filter: 0
+ SCALEOFFSET filter: 0
+ USER-DEFINED filter: 0
+Dataset datatype information:
+ # of unique datatypes used by datasets: 1
+ Dataset datatype #0:
+ Count (total/named) = (2/0)
+ Size (desc./elmt) = (14/4)
+ Total dataset datatype count: 2
+Small # of attributes (objects with 1 to 10 attributes):
+ Total # of objects with small # of attributes: 0
+Attribute bins:
+ Total # of objects with attributes: 0
+ Max. # of attributes to objects: 0
+Free-space section threshold: 1 bytes
+Small size free-space sections (< 10 bytes):
+ Total # of small size sections: 0
+Free-space section bins:
+ Total # of sections: 0
+File space management strategy: H5F_FILE_SPACE_ALL
+Summary of file space information:
+ File metadata: 965 bytes
+ Raw data: 110 bytes
+ Amount/Percent of tracked free space: 0 bytes/0.0%
+ Unaccounted space: 1131 bytes
+Total space: 2206 bytes
diff --git a/tools/test/h5stat/testfiles/h5stat_idx.h5 b/tools/test/h5stat/testfiles/h5stat_idx.h5
new file mode 100644
index 0000000..303d1f8
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_idx.h5
Binary files differ
diff --git a/tools/test/h5stat/testfiles/h5stat_links1.ddl b/tools/test/h5stat/testfiles/h5stat_links1.ddl
new file mode 100644
index 0000000..c650f15
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_links1.ddl
@@ -0,0 +1,10 @@
+Filename: h5stat_threshold.h5
+Small groups (with 0 to 7 links):
+ # of groups with 0 link(s): 1
+ # of groups with 7 link(s): 1
+ Total # of small groups: 2
+Group bins:
+ # of groups with 0 link: 1
+ # of groups with 1 - 9 links: 2
+ # of groups with 10 - 99 links: 1
+ Total # of groups: 4
diff --git a/tools/test/h5stat/testfiles/h5stat_links2.ddl b/tools/test/h5stat/testfiles/h5stat_links2.ddl
new file mode 100644
index 0000000..4622884
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_links2.ddl
@@ -0,0 +1,105 @@
+Filename: h5stat_threshold.h5
+File information
+ # of unique groups: 4
+ # of unique datasets: 23
+ # of unique named datatypes: 0
+ # of unique links: 0
+ # of unique other: 0
+ Max. # of links to object: 1
+ Max. # of objects in group: 10
+File space information for file metadata (in bytes):
+ Superblock: 96
+ Superblock extension: 0
+ User block: 0
+ Object headers: (total/unused)
+ Groups: 3576/0
+ Datasets(exclude compact data): 7896/2912
+ Datatypes: 0/0
+ Groups:
+ B-tree/List: 3816
+ Heap: 744
+ Attributes:
+ B-tree/List: 0
+ Heap: 0
+ Chunked datasets:
+ Index: 0
+ Datasets:
+ Heap: 0
+ Shared Messages:
+ Header: 0
+ B-tree/List: 0
+ Heap: 0
+ Free-space managers:
+ Header: 0
+ Amount of free space: 0
+Small groups (with 0 to 7 links):
+ # of groups with 0 link(s): 1
+ # of groups with 7 link(s): 1
+ Total # of small groups: 2
+Group bins:
+ # of groups with 0 link: 1
+ # of groups with 1 - 9 links: 2
+ # of groups with 10 - 99 links: 1
+ Total # of groups: 4
+Dataset dimension information:
+ Max. rank of datasets: 2
+ Dataset ranks:
+ # of dataset with rank 0: 2
+ # of dataset with rank 1: 20
+ # of dataset with rank 2: 1
+1-D Dataset information:
+ Max. dimension size of 1-D datasets: 6
+ Small 1-D datasets (with dimension sizes 0 to 9):
+ # of datasets with dimension sizes 0: 1
+ # of datasets with dimension sizes 6: 19
+ Total # of small datasets: 20
+ 1-D Dataset dimension bins:
+ # of datasets with dimension size 0: 1
+ # of datasets with dimension size 1 - 9: 19
+ Total # of datasets: 20
+Dataset storage information:
+ Total raw data size: 0
+ Total external raw data size: 0
+Dataset layout information:
+ Dataset layout counts[COMPACT]: 0
+ Dataset layout counts[CONTIG]: 23
+ Dataset layout counts[CHUNKED]: 0
+ Dataset layout counts[VIRTUAL]: 0
+ Number of external files : 0
+Dataset filters information:
+ Number of datasets with:
+ NO filter: 23
+ GZIP filter: 0
+ SHUFFLE filter: 0
+ FLETCHER32 filter: 0
+ SZIP filter: 0
+ NBIT filter: 0
+ SCALEOFFSET filter: 0
+ USER-DEFINED filter: 0
+Dataset datatype information:
+ # of unique datatypes used by datasets: 1
+ Dataset datatype #0:
+ Count (total/named) = (23/0)
+ Size (desc./elmt) = (14/1)
+ Total dataset datatype count: 23
+Small # of attributes (objects with 1 to 10 attributes):
+ # of objects with 1 attributes: 2
+ # of objects with 10 attributes: 1
+ Total # of objects with small # of attributes: 3
+Attribute bins:
+ # of objects with 1 - 9 attributes: 2
+ # of objects with 10 - 99 attributes: 3
+ Total # of objects with attributes: 5
+ Max. # of attributes to objects: 25
+Free-space section threshold: 1 bytes
+Small size free-space sections (< 10 bytes):
+ Total # of small size sections: 0
+Free-space section bins:
+ Total # of sections: 0
+File space management strategy: H5F_FILE_SPACE_ALL
+Summary of file space information:
+ File metadata: 16128 bytes
+ Raw data: 0 bytes
+ Amount/Percent of tracked free space: 0 bytes/0.0%
+ Unaccounted space: 184 bytes
+Total space: 16312 bytes
diff --git a/tools/test/h5stat/testfiles/h5stat_links3.ddl b/tools/test/h5stat/testfiles/h5stat_links3.ddl
new file mode 100644
index 0000000..f80471a
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_links3.ddl
@@ -0,0 +1,12 @@
+Filename: h5stat_threshold.h5
+Small groups (with 0 to 19 links):
+ # of groups with 0 link(s): 1
+ # of groups with 7 link(s): 1
+ # of groups with 9 link(s): 1
+ # of groups with 10 link(s): 1
+ Total # of small groups: 4
+Group bins:
+ # of groups with 0 link: 1
+ # of groups with 1 - 9 links: 2
+ # of groups with 10 - 99 links: 1
+ Total # of groups: 4
diff --git a/tools/test/h5stat/testfiles/h5stat_links4.ddl b/tools/test/h5stat/testfiles/h5stat_links4.ddl
new file mode 100644
index 0000000..94feffd
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_links4.ddl
@@ -0,0 +1,8 @@
+Filename: h5stat_newgrat.h5
+Small groups (with 0 to 9 links):
+ # of groups with 0 link(s): 35000
+ Total # of small groups: 35000
+Group bins:
+ # of groups with 0 link: 35000
+ # of groups with 10000 - 99999 links: 1
+ Total # of groups: 35001
diff --git a/tools/test/h5stat/testfiles/h5stat_links5.ddl b/tools/test/h5stat/testfiles/h5stat_links5.ddl
new file mode 100644
index 0000000..6f33bed
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_links5.ddl
@@ -0,0 +1,9 @@
+Filename: h5stat_newgrat.h5
+Small groups (with 0 to 39999 links):
+ # of groups with 0 link(s): 35000
+ # of groups with 35001 link(s): 1
+ Total # of small groups: 35001
+Group bins:
+ # of groups with 0 link: 35000
+ # of groups with 10000 - 99999 links: 1
+ Total # of groups: 35001
diff --git a/tools/test/h5stat/testfiles/h5stat_newgrat-UA.ddl b/tools/test/h5stat/testfiles/h5stat_newgrat-UA.ddl
new file mode 100644
index 0000000..a5ee7e8
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_newgrat-UA.ddl
@@ -0,0 +1,7 @@
+Filename: h5stat_newgrat.h5
+Small # of attributes (objects with 1 to 10 attributes):
+ Total # of objects with small # of attributes: 0
+Attribute bins:
+ # of objects with 100 - 999 attributes: 1
+ Total # of objects with attributes: 1
+ Max. # of attributes to objects: 100
diff --git a/tools/test/h5stat/testfiles/h5stat_newgrat-UG.ddl b/tools/test/h5stat/testfiles/h5stat_newgrat-UG.ddl
new file mode 100644
index 0000000..41195ac
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_newgrat-UG.ddl
@@ -0,0 +1,5 @@
+Filename: h5stat_newgrat.h5
+File space information for groups' metadata (in bytes):
+ Object headers (total/unused): 5145147/3220092
+ B-tree/List: 470054
+ Heap: 739045
diff --git a/tools/test/h5stat/testfiles/h5stat_newgrat.ddl b/tools/test/h5stat/testfiles/h5stat_newgrat.ddl
new file mode 100644
index 0000000..e305f58
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_newgrat.ddl
@@ -0,0 +1,95 @@
+Filename: h5stat_newgrat.h5
+File information
+ # of unique groups: 35001
+ # of unique datasets: 1
+ # of unique named datatypes: 0
+ # of unique links: 0
+ # of unique other: 0
+ Max. # of links to object: 1
+ Max. # of objects in group: 35001
+File space information for file metadata (in bytes):
+ Superblock: 48
+ Superblock extension: 119
+ User block: 0
+ Object headers: (total/unused)
+ Groups: 5145147/3220092
+ Datasets(exclude compact data): 414/312
+ Datatypes: 0/0
+ Groups:
+ B-tree/List: 470054
+ Heap: 739045
+ Attributes:
+ B-tree/List: 2598
+ Heap: 4431
+ Chunked datasets:
+ Index: 0
+ Datasets:
+ Heap: 0
+ Shared Messages:
+ Header: 0
+ B-tree/List: 0
+ Heap: 0
+ Free-space managers:
+ Header: 180
+ Amount of free space: 132
+Small groups (with 0 to 9 links):
+ # of groups with 0 link(s): 35000
+ Total # of small groups: 35000
+Group bins:
+ # of groups with 0 link: 35000
+ # of groups with 10000 - 99999 links: 1
+ Total # of groups: 35001
+Dataset dimension information:
+ Max. rank of datasets: 0
+ Dataset ranks:
+ # of dataset with rank 0: 1
+1-D Dataset information:
+ Max. dimension size of 1-D datasets: 0
+ Small 1-D datasets (with dimension sizes 0 to 9):
+ Total # of small datasets: 0
+Dataset storage information:
+ Total raw data size: 0
+ Total external raw data size: 0
+Dataset layout information:
+ Dataset layout counts[COMPACT]: 0
+ Dataset layout counts[CONTIG]: 1
+ Dataset layout counts[CHUNKED]: 0
+ Dataset layout counts[VIRTUAL]: 0
+ Number of external files : 0
+Dataset filters information:
+ Number of datasets with:
+ NO filter: 1
+ GZIP filter: 0
+ SHUFFLE filter: 0
+ FLETCHER32 filter: 0
+ SZIP filter: 0
+ NBIT filter: 0
+ SCALEOFFSET filter: 0
+ USER-DEFINED filter: 0
+Dataset datatype information:
+ # of unique datatypes used by datasets: 1
+ Dataset datatype #0:
+ Count (total/named) = (1/0)
+ Size (desc./elmt) = (14/4)
+ Total dataset datatype count: 1
+Small # of attributes (objects with 1 to 10 attributes):
+ Total # of objects with small # of attributes: 0
+Attribute bins:
+ # of objects with 100 - 999 attributes: 1
+ Total # of objects with attributes: 1
+ Max. # of attributes to objects: 100
+Free-space section threshold: 1 bytes
+Small size free-space sections (< 10 bytes):
+ # of sections of size 1: 1
+ Total # of small size sections: 1
+Free-space section bins:
+ # of sections of size 1 - 9: 1
+ # of sections of size 10 - 99: 4
+ Total # of sections: 5
+File space management strategy: H5F_FILE_SPACE_ALL_PERSIST
+Summary of file space information:
+ File metadata: 6362036 bytes
+ Raw data: 0 bytes
+ Amount/Percent of tracked free space: 132 bytes/0.0%
+ Unaccounted space: 0 bytes
+Total space: 6362168 bytes
diff --git a/tools/test/h5stat/testfiles/h5stat_newgrat.h5 b/tools/test/h5stat/testfiles/h5stat_newgrat.h5
new file mode 100644
index 0000000..c919b71
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_newgrat.h5
Binary files differ
diff --git a/tools/test/h5stat/testfiles/h5stat_nofile.ddl b/tools/test/h5stat/testfiles/h5stat_nofile.ddl
new file mode 100644
index 0000000..d8a8b2c
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_nofile.ddl
@@ -0,0 +1,25 @@
+Usage: h5stat [OPTIONS] file
+
+ OPTIONS
+ -h, --help Print a usage message and exit
+ -V, --version Print version number and exit
+ -f, --file Print file information
+ -F, --filemetadata Print file space information for file's metadata
+ -g, --group Print group information
+ -l N, --links=N Set the threshold for the # of links when printing
+ information for small groups. N is an integer greater
+ than 0. The default threshold is 10.
+ -G, --groupmetadata Print file space information for groups' metadata
+ -d, --dset Print dataset information
+ -m N, --dims=N Set the threshold for the dimension sizes when printing
+ information for small datasets. N is an integer greater
+ than 0. The default threshold is 10.
+ -D, --dsetmetadata Print file space information for datasets' metadata
+ -T, --dtypemetadata Print datasets' datatype information
+ -A, --attribute Print attribute information
+ -a N, --numattrs=N Set the threshold for the # of attributes when printing
+ information for small # of attributes. N is an integer greater
+ than 0. The default threshold is 10.
+ -s, --freespace Print free space information
+ -S, --summary Print summary of file space information
+h5stat error: missing file name
diff --git a/tools/test/h5stat/testfiles/h5stat_notexist.ddl b/tools/test/h5stat/testfiles/h5stat_notexist.ddl
new file mode 100644
index 0000000..cc25e43
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_notexist.ddl
@@ -0,0 +1,2 @@
+Filename: notexist.h5
+h5stat error: unable to open file "notexist.h5"
diff --git a/tools/test/h5stat/testfiles/h5stat_numattrs1.ddl b/tools/test/h5stat/testfiles/h5stat_numattrs1.ddl
new file mode 100644
index 0000000..fb5568d
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_numattrs1.ddl
@@ -0,0 +1,17 @@
+Filename: h5stat_threshold.h5
+Small # of attributes (objects with 1 to 10 attributes):
+ # of objects with 1 attributes: 2
+ # of objects with 10 attributes: 1
+ Total # of objects with small # of attributes: 3
+Attribute bins:
+ # of objects with 1 - 9 attributes: 2
+ # of objects with 10 - 99 attributes: 3
+ Total # of objects with attributes: 5
+ Max. # of attributes to objects: 25
+File space management strategy: H5F_FILE_SPACE_ALL
+Summary of file space information:
+ File metadata: 16128 bytes
+ Raw data: 0 bytes
+ Amount/Percent of tracked free space: 0 bytes/0.0%
+ Unaccounted space: 184 bytes
+Total space: 16312 bytes
diff --git a/tools/test/h5stat/testfiles/h5stat_numattrs2.ddl b/tools/test/h5stat/testfiles/h5stat_numattrs2.ddl
new file mode 100644
index 0000000..ccb23c1
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_numattrs2.ddl
@@ -0,0 +1,105 @@
+Filename: h5stat_threshold.h5
+File information
+ # of unique groups: 4
+ # of unique datasets: 23
+ # of unique named datatypes: 0
+ # of unique links: 0
+ # of unique other: 0
+ Max. # of links to object: 1
+ Max. # of objects in group: 10
+File space information for file metadata (in bytes):
+ Superblock: 96
+ Superblock extension: 0
+ User block: 0
+ Object headers: (total/unused)
+ Groups: 3576/0
+ Datasets(exclude compact data): 7896/2912
+ Datatypes: 0/0
+ Groups:
+ B-tree/List: 3816
+ Heap: 744
+ Attributes:
+ B-tree/List: 0
+ Heap: 0
+ Chunked datasets:
+ Index: 0
+ Datasets:
+ Heap: 0
+ Shared Messages:
+ Header: 0
+ B-tree/List: 0
+ Heap: 0
+ Free-space managers:
+ Header: 0
+ Amount of free space: 0
+Small groups (with 0 to 9 links):
+ # of groups with 0 link(s): 1
+ # of groups with 7 link(s): 1
+ # of groups with 9 link(s): 1
+ Total # of small groups: 3
+Group bins:
+ # of groups with 0 link: 1
+ # of groups with 1 - 9 links: 2
+ # of groups with 10 - 99 links: 1
+ Total # of groups: 4
+Dataset dimension information:
+ Max. rank of datasets: 2
+ Dataset ranks:
+ # of dataset with rank 0: 2
+ # of dataset with rank 1: 20
+ # of dataset with rank 2: 1
+1-D Dataset information:
+ Max. dimension size of 1-D datasets: 6
+ Small 1-D datasets (with dimension sizes 0 to 9):
+ # of datasets with dimension sizes 0: 1
+ # of datasets with dimension sizes 6: 19
+ Total # of small datasets: 20
+ 1-D Dataset dimension bins:
+ # of datasets with dimension size 0: 1
+ # of datasets with dimension size 1 - 9: 19
+ Total # of datasets: 20
+Dataset storage information:
+ Total raw data size: 0
+ Total external raw data size: 0
+Dataset layout information:
+ Dataset layout counts[COMPACT]: 0
+ Dataset layout counts[CONTIG]: 23
+ Dataset layout counts[CHUNKED]: 0
+ Dataset layout counts[VIRTUAL]: 0
+ Number of external files : 0
+Dataset filters information:
+ Number of datasets with:
+ NO filter: 23
+ GZIP filter: 0
+ SHUFFLE filter: 0
+ FLETCHER32 filter: 0
+ SZIP filter: 0
+ NBIT filter: 0
+ SCALEOFFSET filter: 0
+ USER-DEFINED filter: 0
+Dataset datatype information:
+ # of unique datatypes used by datasets: 1
+ Dataset datatype #0:
+ Count (total/named) = (23/0)
+ Size (desc./elmt) = (14/1)
+ Total dataset datatype count: 23
+Small # of attributes (objects with 1 to 1 attributes):
+ # of objects with 1 attributes: 2
+ Total # of objects with small # of attributes: 2
+Attribute bins:
+ # of objects with 1 - 9 attributes: 2
+ # of objects with 10 - 99 attributes: 3
+ Total # of objects with attributes: 5
+ Max. # of attributes to objects: 25
+Free-space section threshold: 1 bytes
+Small size free-space sections (< 10 bytes):
+ Total # of small size sections: 0
+Free-space section bins:
+ Total # of sections: 0
+File space management strategy: H5F_FILE_SPACE_ALL
+Summary of file space information:
+ File metadata: 16128 bytes
+ Raw data: 0 bytes
+ Amount/Percent of tracked free space: 0 bytes/0.0%
+ Unaccounted space: 184 bytes
+Total space: 16312 bytes
diff --git a/tools/test/h5stat/testfiles/h5stat_numattrs3.ddl b/tools/test/h5stat/testfiles/h5stat_numattrs3.ddl
new file mode 100644
index 0000000..de8d6a3
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_numattrs3.ddl
@@ -0,0 +1,12 @@
+Filename: h5stat_threshold.h5
+Small # of attributes (objects with 1 to 25 attributes):
+ # of objects with 1 attributes: 2
+ # of objects with 10 attributes: 1
+ # of objects with 11 attributes: 1
+ # of objects with 25 attributes: 1
+ Total # of objects with small # of attributes: 5
+Attribute bins:
+ # of objects with 1 - 9 attributes: 2
+ # of objects with 10 - 99 attributes: 3
+ Total # of objects with attributes: 5
+ Max. # of attributes to objects: 25
diff --git a/tools/test/h5stat/testfiles/h5stat_numattrs4.ddl b/tools/test/h5stat/testfiles/h5stat_numattrs4.ddl
new file mode 100644
index 0000000..2b0122a
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_numattrs4.ddl
@@ -0,0 +1,8 @@
+Filename: h5stat_newgrat.h5
+Small # of attributes (objects with 1 to 100 attributes):
+ # of objects with 100 attributes: 1
+ Total # of objects with small # of attributes: 1
+Attribute bins:
+ # of objects with 100 - 999 attributes: 1
+ Total # of objects with attributes: 1
+ Max. # of attributes to objects: 100
diff --git a/tools/test/h5stat/testfiles/h5stat_threshold.h5 b/tools/test/h5stat/testfiles/h5stat_threshold.h5
new file mode 100644
index 0000000..9f7c8c8
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_threshold.h5
Binary files differ
diff --git a/tools/test/h5stat/testfiles/h5stat_tsohm.ddl b/tools/test/h5stat/testfiles/h5stat_tsohm.ddl
new file mode 100644
index 0000000..4cf33fc
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_tsohm.ddl
@@ -0,0 +1,90 @@
+Filename: h5stat_tsohm.h5
+File information
+ # of unique groups: 1
+ # of unique datasets: 3
+ # of unique named datatypes: 0
+ # of unique links: 0
+ # of unique other: 0
+ Max. # of links to object: 1
+ Max. # of objects in group: 3
+File space information for file metadata (in bytes):
+ Superblock: 48
+ Superblock extension: 40
+ User block: 0
+ Object headers: (total/unused)
+ Groups: 51/2
+ Datasets(exclude compact data): 852/447
+ Datatypes: 0/0
+ Groups:
+ B-tree/List: 872
+ Heap: 120
+ Attributes:
+ B-tree/List: 0
+ Heap: 0
+ Chunked datasets:
+ Index: 0
+ Datasets:
+ Heap: 0
+ Shared Messages:
+ Header: 38
+ B-tree/List: 550
+ Heap: 1279
+ Free-space managers:
+ Header: 0
+ Amount of free space: 0
+Small groups (with 0 to 9 links):
+ # of groups with 3 link(s): 1
+ Total # of small groups: 1
+Group bins:
+ # of groups with 1 - 9 links: 1
+ Total # of groups: 1
+Dataset dimension information:
+ Max. rank of datasets: 2
+ Dataset ranks:
+ # of dataset with rank 2: 3
+1-D Dataset information:
+ Max. dimension size of 1-D datasets: 0
+ Small 1-D datasets (with dimension sizes 0 to 9):
+ Total # of small datasets: 0
+Dataset storage information:
+ Total raw data size: 0
+ Total external raw data size: 0
+Dataset layout information:
+ Dataset layout counts[COMPACT]: 0
+ Dataset layout counts[CONTIG]: 0
+ Dataset layout counts[CHUNKED]: 3
+ Dataset layout counts[VIRTUAL]: 0
+ Number of external files : 0
+Dataset filters information:
+ Number of datasets with:
+ NO filter: 3
+ GZIP filter: 0
+ SHUFFLE filter: 0
+ FLETCHER32 filter: 0
+ SZIP filter: 0
+ NBIT filter: 0
+ SCALEOFFSET filter: 0
+ USER-DEFINED filter: 0
+Dataset datatype information:
+ # of unique datatypes used by datasets: 1
+ Dataset datatype #0:
+ Count (total/named) = (3/0)
+ Size (desc./elmt) = (14/8)
+ Total dataset datatype count: 3
+Small # of attributes (objects with 1 to 10 attributes):
+ Total # of objects with small # of attributes: 0
+Attribute bins:
+ Total # of objects with attributes: 0
+ Max. # of attributes to objects: 0
+Free-space section threshold: 1 bytes
+Small size free-space sections (< 10 bytes):
+ Total # of small size sections: 0
+Free-space section bins:
+ Total # of sections: 0
+File space management strategy: H5F_FILE_SPACE_ALL
+Summary of file space information:
+ File metadata: 3850 bytes
+ Raw data: 0 bytes
+ Amount/Percent of tracked free space: 0 bytes/0.0%
+ Unaccounted space: 0 bytes
+Total space: 3850 bytes
diff --git a/tools/test/h5stat/testfiles/h5stat_tsohm.h5 b/tools/test/h5stat/testfiles/h5stat_tsohm.h5
new file mode 100644
index 0000000..e6c89f6
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_tsohm.h5
Binary files differ
diff --git a/tools/test/h5stat/testh5stat.sh.in b/tools/test/h5stat/testh5stat.sh.in
new file mode 100644
index 0000000..e94f9bd
--- /dev/null
+++ b/tools/test/h5stat/testh5stat.sh.in
@@ -0,0 +1,318 @@
+#! /bin/sh
+#
+# 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.
+#
+# Tests for the h5stat tool
+#
+# Modifcations:
+# Vailin Choi; July 2013
+# Add tests for -l, -m, -a options
+#
+
+srcdir=@srcdir@
+
+# Determine which filters are available
+USE_FILTER_SZIP="@USE_FILTER_SZIP@"
+USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@"
+
+TESTNAME=h5stat
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
+STAT=../../src/h5stat/h5stat # The tool name
+STAT_BIN=`pwd`/$STAT # The path of the tool binary
+
+RM='rm -rf'
+CMP='cmp -s'
+DIFF='diff -c'
+CP='cp'
+DIRNAME='dirname'
+LS='ls'
+AWK='awk'
+
+nerrors=0
+verbose=yes
+
+# source dirs
+SRC_TOOLS="$srcdir/../.."
+SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles"
+
+# testfiles source dirs for tools
+SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES"
+SRC_H5DUMP_TESTFILES="$SRC_TOOLS_TESTFILES"
+SRC_H5DIFF_TESTFILES="$SRC_TOOLS/test/h5diff/testfiles"
+SRC_H5COPY_TESTFILES="$SRC_TOOLS/test/h5copy/testfiles"
+SRC_H5REPACK_TESTFILES="$SRC_TOOLS/test/h5repack/testfiles"
+SRC_H5JAM_TESTFILES="$SRC_TOOLS/test/h5jam/testfiles"
+SRC_H5STAT_TESTFILES="$SRC_TOOLS/test/h5stat/testfiles"
+SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/test/h5import/testfiles"
+
+TESTDIR=./testfiles
+test -d $TESTDIR || mkdir $TESTDIR
+
+######################################################################
+# test files
+# --------------------------------------------------------------------
+# All the test files copy from source directory to test directory
+# NOTE: Keep this framework to add/remove test files.
+# Any test files from other tools can be used in this framework.
+# This list are also used for checking exist.
+# Comment '#' without space can be used.
+# --------------------------------------------------------------------
+LIST_HDF5_TEST_FILES="
+$SRC_H5STAT_TESTFILES/h5stat_filters.h5
+$SRC_H5STAT_TESTFILES/h5stat_tsohm.h5
+$SRC_H5STAT_TESTFILES/h5stat_newgrat.h5
+$SRC_H5STAT_TESTFILES/h5stat_idx.h5
+$SRC_H5STAT_TESTFILES/h5stat_threshold.h5
+"
+
+LIST_OTHER_TEST_FILES="
+$SRC_H5STAT_TESTFILES/h5stat_help1.ddl
+$SRC_H5STAT_TESTFILES/h5stat_help2.ddl
+$SRC_H5STAT_TESTFILES/h5stat_notexist.ddl
+$SRC_H5STAT_TESTFILES/h5stat_nofile.ddl
+$SRC_H5STAT_TESTFILES/h5stat_filters.ddl
+$SRC_H5STAT_TESTFILES/h5stat_filters-file.ddl
+$SRC_H5STAT_TESTFILES/h5stat_filters-F.ddl
+$SRC_H5STAT_TESTFILES/h5stat_filters-d.ddl
+$SRC_H5STAT_TESTFILES/h5stat_filters-g.ddl
+$SRC_H5STAT_TESTFILES/h5stat_filters-dT.ddl
+$SRC_H5STAT_TESTFILES/h5stat_filters-UD.ddl
+$SRC_H5STAT_TESTFILES/h5stat_filters-UT.ddl
+$SRC_H5STAT_TESTFILES/h5stat_tsohm.ddl
+$SRC_H5STAT_TESTFILES/h5stat_newgrat.ddl
+$SRC_H5STAT_TESTFILES/h5stat_newgrat-UG.ddl
+$SRC_H5STAT_TESTFILES/h5stat_newgrat-UA.ddl
+$SRC_H5STAT_TESTFILES/h5stat_idx.ddl
+$SRC_H5STAT_TESTFILES/h5stat_err1_links.ddl
+$SRC_H5STAT_TESTFILES/h5stat_links1.ddl
+$SRC_H5STAT_TESTFILES/h5stat_links2.ddl
+$SRC_H5STAT_TESTFILES/h5stat_links3.ddl
+$SRC_H5STAT_TESTFILES/h5stat_links4.ddl
+$SRC_H5STAT_TESTFILES/h5stat_links5.ddl
+$SRC_H5STAT_TESTFILES/h5stat_err1_dims.ddl
+$SRC_H5STAT_TESTFILES/h5stat_dims1.ddl
+$SRC_H5STAT_TESTFILES/h5stat_dims2.ddl
+$SRC_H5STAT_TESTFILES/h5stat_err1_numattrs.ddl
+$SRC_H5STAT_TESTFILES/h5stat_err2_numattrs.ddl
+$SRC_H5STAT_TESTFILES/h5stat_numattrs1.ddl
+$SRC_H5STAT_TESTFILES/h5stat_numattrs2.ddl
+$SRC_H5STAT_TESTFILES/h5stat_numattrs3.ddl
+$SRC_H5STAT_TESTFILES/h5stat_numattrs4.ddl
+"
+
+#
+# copy test files and expected output files from source dirs to test dir
+#
+COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES"
+
+COPY_TESTFILES_TO_TESTDIR()
+{
+ # copy test files. Used -f to make sure get a new copy
+ for tstfile in $COPY_TESTFILES
+ do
+ # ignore '#' comment
+ echo $tstfile | tr -d ' ' | grep '^#' > /dev/null
+ RET=$?
+ if [ $RET -eq 1 ]; then
+ # skip cp if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $CP -f $tstfile $TESTDIR
+ if [ $? -ne 0 ]; then
+ echo "Error: FAILED to copy $tstfile ."
+
+ # Comment out this to CREATE expected file
+ exit $EXIT_FAILURE
+ fi
+ fi
+ fi
+ done
+}
+
+CLEAN_TESTFILES_AND_TESTDIR()
+{
+ # skip rm if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=$SRC_H5STAT_TESTFILES
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $RM $TESTDIR
+ fi
+}
+
+# Print a line-line message left justified in a field of 70 characters
+# beginning with the word "Testing".
+#
+TESTING() {
+ SPACES=" "
+ echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
+}
+
+# Source in the output filter function definitions.
+. $srcdir/../../../bin/output_filter.sh
+
+# Run a test and print PASS or *FAIL*. If a test fails then increment
+# the `nerrors' global variable and (if $verbose is set) display the
+# difference between the actual output and the expected output. The
+# expected output is given as the first argument to this function and
+# the actual output file is calculated by replacing the `.ddl' with
+# `.out'. The actual output is not removed if $HDF5_NOCLEANUP has a
+# non-zero value.
+#
+TOOLTEST() {
+ expect="$TESTDIR/$1"
+ actual="$TESTDIR/`basename $1 .ddl`.out"
+ actual_err="$TESTDIR/`basename $1 .ddl`.err"
+ actual_sav=${actual}-sav
+ actual_err_sav=${actual_err}-sav
+ shift
+
+ # Run test.
+ TESTING $STAT $@
+ (
+ cd $TESTDIR
+ $RUNSERIAL $STAT_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
+ cat $actual_err >> $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
+ echo " PASSED"
+ 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 $STAT $@
+ echo " -SKIP-"
+}
+
+
+
+##############################################################################
+##############################################################################
+### T H E T E S T S ###
+##############################################################################
+##############################################################################
+# prepare for test
+COPY_TESTFILES_TO_TESTDIR
+
+# Test for help flag
+TOOLTEST h5stat_help1.ddl -h
+TOOLTEST h5stat_help2.ddl --help
+# Test when h5stat a file that does not exist
+TOOLTEST h5stat_notexist.ddl notexist.h5
+TOOLTEST h5stat_nofile.ddl ''
+
+# 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
+TOOLTEST h5stat_filters.ddl h5stat_filters.h5
+TOOLTEST h5stat_filters-file.ddl -f h5stat_filters.h5
+TOOLTEST h5stat_filters-F.ddl -F h5stat_filters.h5
+TOOLTEST h5stat_filters-d.ddl -d h5stat_filters.h5
+TOOLTEST h5stat_filters-g.ddl -g h5stat_filters.h5
+TOOLTEST h5stat_filters-dT.ddl -dT h5stat_filters.h5
+TOOLTEST h5stat_filters-UD.ddl -D h5stat_filters.h5
+TOOLTEST h5stat_filters-UT.ddl -T h5stat_filters.h5
+#
+# h5stat_tsohm.h5 is a copy of ../../../test/tsohm.h5 generated by tsohm.c
+# as of release 1.8.7-snap0 (on a 64-bit machine)
+TOOLTEST h5stat_tsohm.ddl h5stat_tsohm.h5
+# h5stat_newgrat.h5 is generated by h5stat_gentest.c
+TOOLTEST h5stat_newgrat.ddl h5stat_newgrat.h5
+TOOLTEST h5stat_newgrat-UG.ddl -G h5stat_newgrat.h5
+TOOLTEST h5stat_newgrat-UA.ddl -A h5stat_newgrat.h5
+# h5stat_idx.h5 is generated by h5stat_gentest.c
+TOOLTEST h5stat_idx.ddl h5stat_idx.h5
+#
+# Tests for -l (--links) option on h5stat_threshold.h5:
+# -l 0 (incorrect threshold value)
+# -g -l 8
+# --links=8
+# --links=20 -g
+TOOLTEST h5stat_err1_links.ddl -l 0 h5stat_threshold.h5
+TOOLTEST h5stat_links1.ddl -g -l 8 h5stat_threshold.h5
+TOOLTEST h5stat_links2.ddl --links=8 h5stat_threshold.h5
+TOOLTEST h5stat_links3.ddl --links=20 -g h5stat_threshold.h5
+#
+# Tests for -l (--links) option on h5stat_newgrat.h5:
+# -g
+# -g -l 40000
+TOOLTEST h5stat_links4.ddl -g h5stat_newgrat.h5
+TOOLTEST h5stat_links5.ddl -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
+TOOLTEST h5stat_err1_dims.ddl -d --dims=-1 h5stat_threshold.h5
+TOOLTEST h5stat_dims1.ddl -gd -m 5 h5stat_threshold.h5
+TOOLTEST h5stat_dims2.ddl -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
+TOOLTEST h5stat_err1_numattrs.ddl -a -2 h5stat_threshold.h5
+TOOLTEST h5stat_err2_numattrs.ddl --numattrs h5stat_threshold.h5
+TOOLTEST h5stat_numattrs1.ddl -AS -a 10 h5stat_threshold.h5
+TOOLTEST h5stat_numattrs2.ddl -a 1 h5stat_threshold.h5
+TOOLTEST h5stat_numattrs3.ddl -A --numattrs=25 h5stat_threshold.h5
+#
+# Tests for -a option on h5stat_newgrat.h5
+# -A -a 100
+TOOLTEST h5stat_numattrs4.ddl -A -a 100 h5stat_newgrat.h5
+#
+
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
+
+if test $nerrors -eq 0 ; then
+ echo "All $TESTNAME tests passed."
+ exit $EXIT_SUCCESS
+else
+ echo "$TESTNAME tests failed with $nerrors errors."
+ exit $EXIT_FAILURE
+fi
+