From 27feb0357f455ff19e382b0a51cd1c3926d1156f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 28 Dec 2016 15:03:17 -0600 Subject: Fix h5test.h include issue --- hl/test/CMakeLists.txt | 4 +-- hl/tools/h5watch/CMakeLists.txt | 8 +++--- hl/tools/h5watch/extend_dset.c | 57 ++++++++++++++++++++--------------------- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/hl/test/CMakeLists.txt b/hl/test/CMakeLists.txt index 42a175f..987c5bb 100644 --- a/hl/test/CMakeLists.txt +++ b/hl/test/CMakeLists.txt @@ -14,8 +14,8 @@ PROJECT (HDF5_HL_TEST) set (srcdir ${CMAKE_CURRENT_SOURCE_DIR}) configure_file (${HDF5_HL_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY) -INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) +include_directories (${CMAKE_CURRENT_BINARY_DIR}) +include_directories (${HDF5_TEST_SRC_DIR}) # -------------------------------------------------------------------- # Macro used to add a unit test diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index e3a7e9d..c982c8f 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -9,9 +9,9 @@ set (H5WATCH_SOURCES ) #-- Add h5watch program -INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) -INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_DIR}/src) -INCLUDE_DIRECTORIES (${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}) +include_directories (${HDF5_TOOLS_DIR}/lib) +include_directories (${HDF5_HL_TOOLS_DIR}/src) +include_directories (${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}) add_executable (h5watch ${H5WATCH_SOURCES}) TARGET_NAMING (h5watch STATIC) @@ -20,6 +20,8 @@ target_link_libraries (h5watch ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_T set_target_properties (h5watch PROPERTIES FOLDER tools/hl) if (BUILD_TESTING) + include_directories (${HDF5_TEST_SRC_DIR}) + include_directories(${HDF5_HL_SRC_DIR}/test) #-- Add swmr_check_compat_vfd program set (hl_swmr_check_compat_vfd_SOURCES ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/swmr_check_compat_vfd.c diff --git a/hl/tools/h5watch/extend_dset.c b/hl/tools/h5watch/extend_dset.c index 4038a4f..f6b4161 100644 --- a/hl/tools/h5watch/extend_dset.c +++ b/hl/tools/h5watch/extend_dset.c @@ -13,8 +13,7 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include "H5HLprivate2.h" -#include "h5test.h" +#include "h5hltest.h" /* * Extending datasets in WATCH.h5 generated by h5watchgentest.c @@ -35,24 +34,24 @@ /* Size of data buffer */ #define TEST_BUF_SIZE 100 -/* +/* * Test variations (incremental) for one-dimensional dataset: - * Varies from 10->13->12->12->1->3 + * Varies from 10->13->12->12->1->3 */ -#define ONE_NTESTS 5 +#define ONE_NTESTS 5 int one_tests[ONE_NTESTS] = {3, -1, 0, -11, 2}; -/* +/* * Test variations (incremental) for two-dimensional dataset: - * Varies from {4,10}->{6,12}->{8,1}->{10,1}-> - * {3,3}->{2,2}->{1,2}-> - * {1,4}->{1,3}->{1,3} + * Varies from {4,10}->{6,12}->{8,1}->{10,1}-> + * {3,3}->{2,2}->{1,2}-> + * {1,4}->{1,3}->{1,3} */ #define TWO_NTESTS 9 int two_tests[TWO_NTESTS][2] = { {2, 2}, {2, -11}, {2, 0}, {-7, 2}, {-1, -1}, {-1, 0}, - {0, 2}, {0, -1}, {0, 0} - }; + {0, 2}, {0, -1}, {0, 0} + }; static herr_t extend_dset_two(const char *file, char *dname); static herr_t extend_dset_one(const char *file, char *dname); @@ -87,7 +86,7 @@ typedef struct set_t { *********************************************************************** * * Extending a two-dimensional dataset: - * dims[0] dims[1] + * dims[0] dims[1] * ------- ------- * case #1: increase increase * case #2: increase decrease @@ -99,12 +98,12 @@ typedef struct set_t { * case #8: same decrease (no action) * case #9: same same (no action) * - * two_tests[TWO_NTESTS][2] = { {2,2}, {2,-11}, {2,0}, + * two_tests[TWO_NTESTS][2] = { {2,2}, {2,-11}, {2,0}, * {-7,2}, {-1,-1}, {-1,0}, * {0,2}, {0,-1}, {0,0} } - * varies from {4,10}->{6,12}->{8,1}->{10,1}-> - * {3,3}->{2,2}->{1,2}-> - * {1,4}->{1,3}->{1,3} + * varies from {4,10}->{6,12}->{8,1}->{10,1}-> + * {3,3}->{2,2}->{1,2}-> + * {1,4}->{1,3}->{1,3} *********************************************************************** */ static herr_t @@ -172,7 +171,7 @@ extend_dset_two(const char *file, char *dname) /* sleep to emulate about 2 seconds of application operation */ HDsleep(2); - /* Get current dimension sizes */ + /* Get current dimension sizes */ if(H5LDget_dset_dims(did, cur_dims) < 0) goto error; @@ -187,7 +186,7 @@ extend_dset_two(const char *file, char *dname) num_elmts = 1; for(j = 0; j < (unsigned)ndims; j++) num_elmts *= (unsigned)ext_dims[j]; - + /* Compound type */ if(!HDstrcmp(dname, DSET_CMPD_TWO)) { @@ -254,15 +253,15 @@ error: *********************************************************************** * * Extending a one-dimensional dataset - * Test cases: - * #1: increase - * #2: decrease - * #3: same - * #4: decrease - * #5: increase + * Test cases: + * #1: increase + * #2: decrease + * #3: same + * #4: decrease + * #5: increase * - * one_tests[ONE_NTESTS] = {3, -1, 0, -11, 2} - * varies from 10->13->12->12->1->3 + * one_tests[ONE_NTESTS] = {3, -1, 0, -11, 2} + * varies from 10->13->12->12->1->3 * *********************************************************************** */ @@ -441,13 +440,13 @@ main(int argc, const char *argv[]) dname = HDstrdup(argv[2]); if(!HDstrcmp(dname, DSET_CMPD) || !HDstrcmp(dname, DSET_CMPD_ESC)) { - if(extend_dset_one(fname, dname) < 0) + if(extend_dset_one(fname, dname) < 0) goto error; } else if(!HDstrcmp(dname, DSET_ONE) || !HDstrcmp(dname, DSET_ALLOC_LATE) || !HDstrcmp(dname, DSET_ALLOC_EARLY)) { - if(extend_dset_one(fname, dname) < 0) + if(extend_dset_one(fname, dname) < 0) goto error; } else if(!HDstrcmp(dname, DSET_TWO) || !HDstrcmp(dname, DSET_CMPD_TWO)) { - if(extend_dset_two(fname, dname) < 0) + if(extend_dset_two(fname, dname) < 0) goto error; } else { HDfprintf(stdout, "Dataset cannot be extended...\n"); -- cgit v0.12 From 9b0f236d8cc833f9103a64654d46997695172ea8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 28 Dec 2016 15:09:57 -0600 Subject: Add hl test dir and test dlib --- hl/tools/h5watch/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hl/tools/h5watch/Makefile.am b/hl/tools/h5watch/Makefile.am index 35a08e6..bc12f19 100644 --- a/hl/tools/h5watch/Makefile.am +++ b/hl/tools/h5watch/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/config/commence.am # Include src and tools/lib directories -AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/src +AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/src -I$(top_srcdir)/hl/test # These are our main targets, the tools TEST_SCRIPT=testh5watch.sh @@ -36,7 +36,7 @@ h5watch_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) # Programs all depend on the hdf5 library, the tools library, and the HL # library. -LDADD=$(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) +LDADD=$(LIBH5_HL) $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) # Add extend_dset specific preprocessor flags here # (add the main test subdirectory to the include file path) -- cgit v0.12 From 518a94dd0fcae607c263f16c2b2d823c84b9b647 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 28 Dec 2016 15:20:09 -0600 Subject: Add test lib to extend_dset test link line --- hl/tools/h5watch/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hl/tools/h5watch/CMakeLists.txt b/hl/tools/h5watch/CMakeLists.txt index c982c8f..6d55abc 100644 --- a/hl/tools/h5watch/CMakeLists.txt +++ b/hl/tools/h5watch/CMakeLists.txt @@ -39,7 +39,7 @@ if (BUILD_TESTING) add_executable (extend_dset ${extend_dset_SOURCES}) TARGET_NAMING (extend_dset STATIC) TARGET_C_PROPERTIES (extend_dset STATIC " " " ") - target_link_libraries (extend_dset ${HDF5_HL_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + target_link_libraries (extend_dset ${HDF5_HL_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (extend_dset PROPERTIES FOLDER tools/hl) add_executable (h5watchgentest ${HDF5_HL_TOOLS_H5WATCH_SOURCE_DIR}/h5watchgentest.c) -- cgit v0.12 From 508714805a5faa1775bfea5a8257d7130bd0a15e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 28 Dec 2016 15:31:58 -0600 Subject: hdf5 lib needed for extend_dset link. --- hl/tools/h5watch/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hl/tools/h5watch/Makefile.am b/hl/tools/h5watch/Makefile.am index bc12f19..b017e09 100644 --- a/hl/tools/h5watch/Makefile.am +++ b/hl/tools/h5watch/Makefile.am @@ -36,14 +36,14 @@ h5watch_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) # Programs all depend on the hdf5 library, the tools library, and the HL # library. -LDADD=$(LIBH5_HL) $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) +LDADD=$(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) # Add extend_dset specific preprocessor flags here # (add the main test subdirectory to the include file path) extend_dset_CPPFLAGS=$(AM_CPPFLAGS) -I$(top_srcdir)/test # Add extend_dset specific library flags here # (add the main test library to the list of libraries) -extend_dset_LDADD=$(LDADD) $(LIBH5TEST) +extend_dset_LDADD=$(LDADD) $(LIBH5TEST) $(LIBHDF5) # CHECK_CLEANFILES+=*.h5 -- cgit v0.12