summaryrefslogtreecommitdiffstats
path: root/tools/h5stat
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5stat')
-rw-r--r--tools/h5stat/CMakeTests.cmake144
-rw-r--r--tools/h5stat/h5stat.c2
-rw-r--r--tools/h5stat/h5stat_gentest.c2
3 files changed, 49 insertions, 99 deletions
diff --git a/tools/h5stat/CMakeTests.cmake b/tools/h5stat/CMakeTests.cmake
index 40885a1..885cfd1 100644
--- a/tools/h5stat/CMakeTests.cmake
+++ b/tools/h5stat/CMakeTests.cmake
@@ -20,37 +20,37 @@
# 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
+ h5stat_help1
+ h5stat_help2
+ h5stat_notexist
+ h5stat_nofile
+ h5stat_filters
+ h5stat_filters-file
+ h5stat_filters-F
+ h5stat_filters-d
+ h5stat_filters-g
+ h5stat_filters-dT
+ h5stat_filters-UD
+ h5stat_filters-UT
+ h5stat_tsohm
+ h5stat_newgrat
+ h5stat_newgrat-UG
+ h5stat_newgrat-UA
+ h5stat_err1_links
+ h5stat_links1
+ h5stat_links2
+ h5stat_links3
+ h5stat_links4
+ h5stat_links5
+ h5stat_err1_dims
+ h5stat_dims1
+ h5stat_dims2
+ h5stat_err1_numattrs
+ h5stat_err2_numattrs
+ h5stat_numattrs1
+ h5stat_numattrs2
+ h5stat_numattrs3
+ h5stat_numattrs4
)
set (HDF5_REFERENCE_TEST_FILES
h5stat_filters.h5
@@ -60,7 +60,7 @@
)
foreach (ddl_file ${HDF5_REFERENCE_FILES})
- HDFTEST_COPY_FILE("${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${ddl_file}" "${PROJECT_BINARY_DIR}/${ddl_file}" "h5stat_files")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${ddl_file}.ddl" "${PROJECT_BINARY_DIR}/${ddl_file}.ddl" "h5stat_files")
endforeach ()
foreach (h5_file ${HDF5_REFERENCE_TEST_FILES})
@@ -78,7 +78,7 @@
# 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")
+ if (NOT "${resultcode}" STREQUAL "0")
set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
if (NOT "${last_test}" STREQUAL "")
@@ -86,6 +86,16 @@
endif ()
else (HDF5_ENABLE_USING_MEMCHECKER)
add_test (
+ NAME H5STAT-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove
+ ${resultfile}.out
+ ${resultfile}.out.err
+ )
+ if (NOT "${last_test}" STREQUAL "")
+ set_tests_properties (H5STAT-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test})
+ endif ()
+ add_test (
NAME H5STAT-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5stat>"
@@ -96,6 +106,7 @@
-D "TEST_REFERENCE=${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
+ set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS H5STAT-${resultfile}-clear-objects)
endif ()
endmacro ()
@@ -107,72 +118,13 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
# Remove any output file left over from previous test run
+ foreach (ddl_file ${HDF5_REFERENCE_FILES})
+ set (CLEAR_LIST ${CLEAR_LIST} ${ddl_file}.out ${ddl_file}.out.err)
+ endforeach ()
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
+ -E remove ${CLEAR_LIST}
)
if (NOT "${last_test}" STREQUAL "")
set_tests_properties (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test})
diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c
index aa43645..1357952 100644
--- a/tools/h5stat/h5stat.c
+++ b/tools/h5stat/h5stat.c
@@ -11,8 +11,6 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include <stdlib.h>
-#include <string.h>
#include "H5private.h" /* Generic Functions */
#include "h5tools.h"
#include "h5tools_utils.h"
diff --git a/tools/h5stat/h5stat_gentest.c b/tools/h5stat/h5stat_gentest.c
index 42e352e..6031808 100644
--- a/tools/h5stat/h5stat_gentest.c
+++ b/tools/h5stat/h5stat_gentest.c
@@ -64,7 +64,7 @@ gen_newgrat_file(const char *fname)
if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
goto error;
- /* Create dataset */
+ /* Create file */
if((fid = H5Fcreate(NEWGRAT_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;