diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-03-17 21:38:20 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-03-17 21:38:20 (GMT) |
commit | fd547cd11ffa59c66aa93a5c55f6b979792e76d7 (patch) | |
tree | fcca518af22b90099a766da4419e593d373cd390 /perform | |
parent | 8a14f5dc0ecf2a550916d5fd8ff5804d6e641240 (diff) | |
download | hdf5-fd547cd11ffa59c66aa93a5c55f6b979792e76d7.zip hdf5-fd547cd11ffa59c66aa93a5c55f6b979792e76d7.tar.gz hdf5-fd547cd11ffa59c66aa93a5c55f6b979792e76d7.tar.bz2 |
[svn-r18413] Description:
Unify srcdir handling for test executables and allow them to use the srcdir
setting from configure time without requiring the 'srcdir' environment variable
be set (although you still can, to override the built in setting). Attempted
to get this right for Windows builds also.
Also add dependency between src/H5Tinit.c and src/libhdf5.settings, so
that the test/testcheck_version.sh script works correctly.
Tested on:
Linux/32 2.6 (jam)
Mac OS X/32 10.6.2 (amazon)
Diffstat (limited to 'perform')
-rw-r--r-- | perform/H5srcdir.h.in | 52 | ||||
-rw-r--r-- | perform/Makefile.in | 8 | ||||
-rw-r--r-- | perform/perf_meta.c | 4 | ||||
-rw-r--r-- | perform/sio_perf.h | 1 |
4 files changed, 60 insertions, 5 deletions
diff --git a/perform/H5srcdir.h.in b/perform/H5srcdir.h.in new file mode 100644 index 0000000..b7a75af --- /dev/null +++ b/perform/H5srcdir.h.in @@ -0,0 +1,52 @@ +/* If you are reading this file and it has a '.h' suffix, it was automatically + * generated from the '.in' version. Make changes there. + */ + +/* Set the 'srcdir' path from configure time */ +static const char *config_srcdir = "@srcdir@"; + +/* Buffer to construct path in and return pointer to */ +static char srcdir_path[1024] = ""; + +/* Buffer to construct file in and return pointer to */ +static char srcdir_testpath[1024] = ""; + +/* Append the test file name to the srcdir path and return the whole string */ +static const char *H5_get_srcdir_filename(const char *filename) +{ + const char *srcdir = HDgetenv("srcdir"); + + /* Check for using the srcdir from configure time */ + if(NULL == srcdir) + srcdir = config_srcdir; + + /* Build path to test file */ + if((HDstrlen(srcdir) + HDstrlen(filename) + 2) < sizeof(srcdir_testpath)) { + HDstrcpy(srcdir_testpath, srcdir); + HDstrcat(srcdir_testpath, "/"); + HDstrcat(srcdir_testpath, filename); + return(srcdir_testpath); + } /* end if */ + else + return(NULL); +} + +/* Just return the srcdir path */ +static const char *H5_get_srcdir(void) +{ + const char *srcdir = HDgetenv("srcdir"); + + /* Check for using the srcdir from configure time */ + if(NULL == srcdir) + srcdir = config_srcdir; + + /* Build path to all test files */ + if((HDstrlen(srcdir) + 2) < sizeof(srcdir_path)) { + HDstrcpy(srcdir_path, srcdir); + HDstrcat(srcdir_path, "/"); + return(srcdir_path); + } /* end if */ + else + return(NULL); +} + diff --git a/perform/Makefile.in b/perform/Makefile.in index a5a28f5..8b05026 100644 --- a/perform/Makefile.in +++ b/perform/Makefile.in @@ -51,8 +51,8 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/config/commence.am \ +DIST_COMMON = $(srcdir)/H5srcdir.h.in $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/conclude.am COPYING @BUILD_PARALLEL_CONDITIONAL_FALSE@bin_PROGRAMS = \ @BUILD_PARALLEL_CONDITIONAL_FALSE@ h5perf_serial$(EXEEXT) @@ -66,7 +66,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = H5srcdir.h CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" @BUILD_PARALLEL_CONDITIONAL_TRUE@am__EXEEXT_1 = h5perf$(EXEEXT) \ @@ -483,6 +483,8 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +H5srcdir.h: $(top_builddir)/config.status $(srcdir)/H5srcdir.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" diff --git a/perform/perf_meta.c b/perform/perf_meta.c index 279c8de..b3966d6 100644 --- a/perform/perf_meta.c +++ b/perform/perf_meta.c @@ -20,8 +20,10 @@ * Purpose: Tests performance of metadata */ -#include "h5test.h" +#include <stdlib.h> +#include <string.h> #include <sys/time.h> +#include "h5test.h" #ifdef H5_HAVE_PARALLEL #define MAINPROCESS (!mpi_rank) /* define process 0 as main process */ diff --git a/perform/sio_perf.h b/perform/sio_perf.h index 2417b6f..bd05cfe 100644 --- a/perform/sio_perf.h +++ b/perform/sio_perf.h @@ -18,7 +18,6 @@ #include "sio_timer.h" #ifndef STANDALONE #include "H5private.h" -#include "h5test.h" #include "h5tools_utils.h" #else #include "sio_standalone.h" |