summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-03-18 18:05:13 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-03-18 18:05:13 (GMT)
commita60882019308257ff1da09196f0d3b9129e70346 (patch)
tree5aebcd5d1808cf1452f05773fd62cfbd8fbed12c /test
parent0e58a80e89c70902d65e6163c539fbebe11bfa28 (diff)
downloadhdf5-a60882019308257ff1da09196f0d3b9129e70346.zip
hdf5-a60882019308257ff1da09196f0d3b9129e70346.tar.gz
hdf5-a60882019308257ff1da09196f0d3b9129e70346.tar.bz2
[svn-r18422] Description:
Bring r18413:18420 from trunk to 1.8 branch: - unify srcdir query, etc. - Move libhdf5.settings string out of H5Tinit.c Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.6.2 (amazon) in debug mode Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'test')
-rw-r--r--test/H5srcdir.h74
-rw-r--r--test/H5srcdir_str.h.in22
-rw-r--r--test/Makefile.in12
-rwxr-xr-xtest/cross_read.c1
-rw-r--r--test/dsets.c1
-rw-r--r--test/external.c1
-rw-r--r--test/fillval.c1
-rw-r--r--test/h5test.c1
-rw-r--r--test/links.c1
-rw-r--r--test/mtime.c1
-rwxr-xr-xtest/objcopy.c1
-rw-r--r--test/ohdr.c2
-rw-r--r--test/tarray.c1
-rw-r--r--test/tfile.c1
-rw-r--r--test/th5s.c1
-rw-r--r--test/tmisc.c1
16 files changed, 118 insertions, 4 deletions
diff --git a/test/H5srcdir.h b/test/H5srcdir.h
new file mode 100644
index 0000000..55700cb
--- /dev/null
+++ b/test/H5srcdir.h
@@ -0,0 +1,74 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Quincey Koziol <koziol@hdfgroup.org>
+ * Wednesday, March 17, 2010
+ *
+ * Purpose: srcdir querying support.
+ */
+#ifndef _H5SRCDIR_H
+#define _H5SRCDIR_H
+
+/* Include the header file with the correct relative path for the srcdir string */
+#include "H5srcdir_str.h"
+
+/* 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);
+}
+#endif /* _H5SRCDIR_H */
+
+
diff --git a/test/H5srcdir_str.h.in b/test/H5srcdir_str.h.in
new file mode 100644
index 0000000..d472124
--- /dev/null
+++ b/test/H5srcdir_str.h.in
@@ -0,0 +1,22 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* 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@";
+
diff --git a/test/Makefile.in b/test/Makefile.in
index 7a01edb..ad59f55 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -52,9 +52,10 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/testcheck_version.sh.in $(srcdir)/testerror.sh.in \
- $(srcdir)/testlibinfo.sh.in $(top_srcdir)/config/commence.am \
+DIST_COMMON = $(srcdir)/H5srcdir_str.h.in $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/testcheck_version.sh.in \
+ $(srcdir)/testerror.sh.in $(srcdir)/testlibinfo.sh.in \
+ $(top_srcdir)/config/commence.am \
$(top_srcdir)/config/conclude.am COPYING
check_PROGRAMS = $(am__EXEEXT_1) error_test$(EXEEXT) \
err_compat$(EXEEXT) tcheck_version$(EXEEXT) testmeta$(EXEEXT)
@@ -67,7 +68,8 @@ 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 = testcheck_version.sh testerror.sh testlibinfo.sh
+CONFIG_CLEAN_FILES = testcheck_version.sh testerror.sh H5srcdir_str.h \
+ testlibinfo.sh
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libh5test_la_LIBADD =
@@ -785,6 +787,8 @@ testcheck_version.sh: $(top_builddir)/config.status $(srcdir)/testcheck_version.
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
testerror.sh: $(top_builddir)/config.status $(srcdir)/testerror.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+H5srcdir_str.h: $(top_builddir)/config.status $(srcdir)/H5srcdir_str.h.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
testlibinfo.sh: $(top_builddir)/config.status $(srcdir)/testlibinfo.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
diff --git a/test/cross_read.c b/test/cross_read.c
index b036217..3c64f26 100755
--- a/test/cross_read.c
+++ b/test/cross_read.c
@@ -22,6 +22,7 @@
*/
#include "h5test.h"
+#include "H5srcdir.h"
const char *FILENAME[] = {
"vms_data",
diff --git a/test/dsets.c b/test/dsets.c
index f430897..a269545 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -24,6 +24,7 @@
#include <time.h>
#include "h5test.h"
+#include "H5srcdir.h"
#ifdef H5_HAVE_SZLIB_H
# include "szlib.h"
#endif
diff --git a/test/external.c b/test/external.c
index c2614d5..7c859d4 100644
--- a/test/external.c
+++ b/test/external.c
@@ -20,6 +20,7 @@
* Purpose: Tests datasets stored in external raw files.
*/
#include "h5test.h"
+#include "H5srcdir.h"
/* File for external link test. Created with gen_udlinks.c */
#define LINKED_FILE "be_extlink2.h5"
diff --git a/test/fillval.c b/test/fillval.c
index 2f58380..8584816 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -20,6 +20,7 @@
* Purpose: Tests dataset fill values.
*/
#include "h5test.h"
+#include "H5srcdir.h"
/*
* Define NO_FILLING if you want to compare how this test works when there is
diff --git a/test/h5test.c b/test/h5test.c
index b9f3221..236b9be 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -25,6 +25,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include "h5test.h"
+#include "H5srcdir.h"
#ifdef _WIN32
#include <process.h>
diff --git a/test/links.c b/test/links.c
index c58d3af..3cfc959 100644
--- a/test/links.c
+++ b/test/links.c
@@ -28,6 +28,7 @@
#define H5G_TESTING
#include "h5test.h"
+#include "H5srcdir.h"
#include "H5Gpkg.h" /* Groups */
#include "H5Iprivate.h" /* IDs */
#include "H5Lprivate.h" /* Links */
diff --git a/test/mtime.c b/test/mtime.c
index 741f09a..f28c3e4 100644
--- a/test/mtime.c
+++ b/test/mtime.c
@@ -23,6 +23,7 @@
* working properly.
*/
#include "h5test.h"
+#include "H5srcdir.h"
const char *FILENAME[] = {
"mtime",
diff --git a/test/objcopy.c b/test/objcopy.c
index 854006e..aad08d9 100755
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -22,6 +22,7 @@
#include <time.h>
#include "h5test.h"
+#include "H5srcdir.h"
/*
* This file needs to access private information from the H5S package.
diff --git a/test/ohdr.c b/test/ohdr.c
index c3b8f8b..e26afef 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -17,7 +17,9 @@
* Tuesday, November 24, 1998
*/
#include "h5test.h"
+#include "H5srcdir.h"
#include "H5Iprivate.h"
+
/*
* This file needs to access private datatypes from the H5O package.
* This file also needs to access the object header testing code.
diff --git a/test/tarray.c b/test/tarray.c
index 590d48c..63f98b1 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -22,6 +22,7 @@
*************************************************************/
#include "testhdf5.h"
+#include "H5srcdir.h"
#include "hdf5.h"
diff --git a/test/tfile.c b/test/tfile.c
index 3992c47..dda5422 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -23,6 +23,7 @@
#include "hdf5.h"
#include "testhdf5.h"
+#include "H5srcdir.h"
#include "H5Bprivate.h"
#include "H5Pprivate.h"
diff --git a/test/th5s.c b/test/th5s.c
index a38e384..a57cd80 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -22,6 +22,7 @@
*************************************************************/
#include "testhdf5.h"
+#include "H5srcdir.h"
#include "H5private.h"
#include "H5Bprivate.h"
diff --git a/test/tmisc.c b/test/tmisc.c
index 3a009c5..b2dd2c7 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -30,6 +30,7 @@
#include "hdf5.h"
#include "testhdf5.h"
+#include "H5srcdir.h"
#include "H5Dpkg.h" /* Datasets */
/* Definitions for misc. test #1 */