diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2015-08-24 19:35:43 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2015-08-24 19:35:43 (GMT) |
commit | 5f14a860da768e49246c6e2cebcf68c553625860 (patch) | |
tree | 870efe4a6fd05c2620591c48a5864cd7e6219c76 /hl/tools/h5watch | |
parent | 015670ef672c066b9194b4c8142a55bc8ab5158a (diff) | |
download | hdf5-5f14a860da768e49246c6e2cebcf68c553625860.zip hdf5-5f14a860da768e49246c6e2cebcf68c553625860.tar.gz hdf5-5f14a860da768e49246c6e2cebcf68c553625860.tar.bz2 |
[svn-r27571] - h5watch tests are now skipped when the test VFD does not support SWMR.
- General improvements to the h5watch Makefile.am.
Tested on: jam w/ HDF5_DRIVER=stdio and sec2
Diffstat (limited to 'hl/tools/h5watch')
-rw-r--r-- | hl/tools/h5watch/Makefile.am | 9 | ||||
-rw-r--r-- | hl/tools/h5watch/Makefile.in | 38 | ||||
-rw-r--r-- | hl/tools/h5watch/swmr_check_compat_vfd.c | 59 | ||||
-rw-r--r-- | hl/tools/h5watch/testh5watch.sh.in | 15 |
4 files changed, 99 insertions, 22 deletions
diff --git a/hl/tools/h5watch/Makefile.am b/hl/tools/h5watch/Makefile.am index 2a2c2f3..a5891ef 100644 --- a/hl/tools/h5watch/Makefile.am +++ b/hl/tools/h5watch/Makefile.am @@ -26,19 +26,14 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/sr # These are our main targets, the tools TEST_SCRIPT=testh5watch.sh check_SCRIPTS=$(TEST_SCRIPT) -SCRIPT_DEPEND=h5watch$(EXEEXT) +SCRIPT_DEPEND=swmr_check_compat_vfd$(EXEEXT) extend_dset$(EXEEXT) h5watch$(EXEEXT) bin_PROGRAMS=h5watch -noinst_PROGRAMS=h5watchgentest extend_dset +noinst_PROGRAMS=swmr_check_compat_vfd h5watchgentest extend_dset # Add h5watch specific linker flags here h5watch_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) -h5watch_SOURCES=h5watch.c - -h5watchgentest_SOURCES=h5watchgentest.c -extend_dset_SOURCES=extend_dset.c - # Programs all depend on the hdf5 library, the tools library, and the HL # library. LDADD=$(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) diff --git a/hl/tools/h5watch/Makefile.in b/hl/tools/h5watch/Makefile.in index 77545ca..afba745 100644 --- a/hl/tools/h5watch/Makefile.in +++ b/hl/tools/h5watch/Makefile.in @@ -101,7 +101,8 @@ DIST_COMMON = $(top_srcdir)/config/commence.am \ $(srcdir)/testh5watch.sh.in $(top_srcdir)/bin/depcomp \ $(top_srcdir)/bin/test-driver bin_PROGRAMS = h5watch$(EXEEXT) -noinst_PROGRAMS = h5watchgentest$(EXEEXT) extend_dset$(EXEEXT) +noinst_PROGRAMS = swmr_check_compat_vfd$(EXEEXT) \ + h5watchgentest$(EXEEXT) extend_dset$(EXEEXT) TESTS = $(TEST_SCRIPT) subdir = hl/tools/h5watch ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -115,25 +116,30 @@ CONFIG_CLEAN_FILES = testh5watch.sh CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) -am_extend_dset_OBJECTS = extend_dset.$(OBJEXT) -extend_dset_OBJECTS = $(am_extend_dset_OBJECTS) +extend_dset_SOURCES = extend_dset.c +extend_dset_OBJECTS = extend_dset.$(OBJEXT) extend_dset_LDADD = $(LDADD) extend_dset_DEPENDENCIES = $(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -am_h5watch_OBJECTS = h5watch.$(OBJEXT) -h5watch_OBJECTS = $(am_h5watch_OBJECTS) +h5watch_SOURCES = h5watch.c +h5watch_OBJECTS = h5watch.$(OBJEXT) h5watch_LDADD = $(LDADD) h5watch_DEPENDENCIES = $(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) h5watch_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(h5watch_LDFLAGS) $(LDFLAGS) -o $@ -am_h5watchgentest_OBJECTS = h5watchgentest.$(OBJEXT) -h5watchgentest_OBJECTS = $(am_h5watchgentest_OBJECTS) +h5watchgentest_SOURCES = h5watchgentest.c +h5watchgentest_OBJECTS = h5watchgentest.$(OBJEXT) h5watchgentest_LDADD = $(LDADD) h5watchgentest_DEPENDENCIES = $(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) +swmr_check_compat_vfd_SOURCES = swmr_check_compat_vfd.c +swmr_check_compat_vfd_OBJECTS = swmr_check_compat_vfd.$(OBJEXT) +swmr_check_compat_vfd_LDADD = $(LDADD) +swmr_check_compat_vfd_DEPENDENCIES = $(LIBH5_HL) $(LIBH5TOOLS) \ + $(LIBHDF5) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -168,10 +174,10 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(extend_dset_SOURCES) $(h5watch_SOURCES) \ - $(h5watchgentest_SOURCES) -DIST_SOURCES = $(extend_dset_SOURCES) $(h5watch_SOURCES) \ - $(h5watchgentest_SOURCES) +SOURCES = extend_dset.c h5watch.c h5watchgentest.c \ + swmr_check_compat_vfd.c +DIST_SOURCES = extend_dset.c h5watch.c h5watchgentest.c \ + swmr_check_compat_vfd.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -670,13 +676,10 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 # These are our main targets, the tools TEST_SCRIPT = testh5watch.sh check_SCRIPTS = $(TEST_SCRIPT) -SCRIPT_DEPEND = h5watch$(EXEEXT) +SCRIPT_DEPEND = swmr_check_compat_vfd$(EXEEXT) extend_dset$(EXEEXT) h5watch$(EXEEXT) # Add h5watch specific linker flags here h5watch_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) -h5watch_SOURCES = h5watch.c -h5watchgentest_SOURCES = h5watchgentest.c -extend_dset_SOURCES = extend_dset.c # Programs all depend on the hdf5 library, the tools library, and the HL # library. @@ -810,6 +813,10 @@ h5watchgentest$(EXEEXT): $(h5watchgentest_OBJECTS) $(h5watchgentest_DEPENDENCIES @rm -f h5watchgentest$(EXEEXT) $(AM_V_CCLD)$(LINK) $(h5watchgentest_OBJECTS) $(h5watchgentest_LDADD) $(LIBS) +swmr_check_compat_vfd$(EXEEXT): $(swmr_check_compat_vfd_OBJECTS) $(swmr_check_compat_vfd_DEPENDENCIES) $(EXTRA_swmr_check_compat_vfd_DEPENDENCIES) + @rm -f swmr_check_compat_vfd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(swmr_check_compat_vfd_OBJECTS) $(swmr_check_compat_vfd_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -819,6 +826,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extend_dset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5watch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5watchgentest.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swmr_check_compat_vfd.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/hl/tools/h5watch/swmr_check_compat_vfd.c b/hl/tools/h5watch/swmr_check_compat_vfd.c new file mode 100644 index 0000000..070572c --- /dev/null +++ b/hl/tools/h5watch/swmr_check_compat_vfd.c @@ -0,0 +1,59 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* Purpose: This is a small program that checks if the HDF5_DRIVER + * environment variable is set to a value that supports SWMR. + * + * It is intended for use in shell scripts. + */ + +#include <stdlib.h> + +#include "H5private.h" + +/* This file needs to access the file driver testing code */ +#define H5FD_PACKAGE +#define H5FD_TESTING +#include "H5FDpkg.h" /* File drivers */ + + +/*------------------------------------------------------------------------- + * Function: main + * + * Purpose: Inspects the HDF5_DRIVER environment variable, which + * determines the VFD that the test harness will use with + * the majority of the tests. + * + * Return: VFD supports SWMR: EXIT_SUCCESS + * + * VFD does not support SWMR + * or failure: EXIT_FAILURE + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ + char *driver = NULL; + + driver = HDgetenv("HDF5_DRIVER"); + + if(H5FD_supports_swmr_test(driver)) + return EXIT_SUCCESS; + else + return EXIT_FAILURE; + +} /* end main() */ + diff --git a/hl/tools/h5watch/testh5watch.sh.in b/hl/tools/h5watch/testh5watch.sh.in index 6de127e..ff31768 100644 --- a/hl/tools/h5watch/testh5watch.sh.in +++ b/hl/tools/h5watch/testh5watch.sh.in @@ -15,6 +15,21 @@ # # Tests for the h5watch tool # + +# Check to see if the VFD specified by the HDF5_DRIVER environment variable +# supports SWMR. +./swmr_check_compat_vfd +rc=$? +if [[ $rc != 0 ]] ; then + echo + echo "The VFD specified by the HDF5_DRIVER environment variable" + echo "does not support SWMR." + echo + echo "h5watch tests skipped" + echo + exit 0 +fi + H5WATCH=h5watch # The tool name H5WATCH_BIN=`pwd`/$H5WATCH # The path of H5WATCH EXTEND_DSET=extend_dset # Routine to extend the dataset when watching |