summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-03-17 21:38:20 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-03-17 21:38:20 (GMT)
commitfd547cd11ffa59c66aa93a5c55f6b979792e76d7 (patch)
treefcca518af22b90099a766da4419e593d373cd390 /testpar
parent8a14f5dc0ecf2a550916d5fd8ff5804d6e641240 (diff)
downloadhdf5-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 'testpar')
-rw-r--r--testpar/H5srcdir.h.in52
-rw-r--r--testpar/Makefile.in9
2 files changed, 58 insertions, 3 deletions
diff --git a/testpar/H5srcdir.h.in b/testpar/H5srcdir.h.in
new file mode 100644
index 0000000..b7a75af
--- /dev/null
+++ b/testpar/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/testpar/Makefile.in b/testpar/Makefile.in
index 86218ea..1413adc 100644
--- a/testpar/Makefile.in
+++ b/testpar/Makefile.in
@@ -50,8 +50,9 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/testph5.sh.in $(top_srcdir)/config/commence.am \
+DIST_COMMON = $(srcdir)/H5srcdir.h.in $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/testph5.sh.in \
+ $(top_srcdir)/config/commence.am \
$(top_srcdir)/config/conclude.am COPYING
check_PROGRAMS = $(am__EXEEXT_1)
TESTS = $(check_PROGRAMS) $(am__EXEEXT_2)
@@ -62,7 +63,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 = testph5.sh
+CONFIG_CLEAN_FILES = H5srcdir.h testph5.sh
CONFIG_CLEAN_VPATH_FILES =
am__EXEEXT_1 = t_mpi$(EXEEXT) t_posix_compliant$(EXEEXT) \
testphdf5$(EXEEXT) t_cache$(EXEEXT) t_pflush1$(EXEEXT) \
@@ -444,6 +445,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)/$@
testph5.sh: $(top_builddir)/config.status $(srcdir)/testph5.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@