summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MANIFEST21
-rw-r--r--c++/test/H5srcdir.h.in22
-rw-r--r--c++/test/H5srcdir_str.h.in (renamed from tools/h5repack/H5srcdir.h.in)0
-rw-r--r--c++/test/th5s.cpp1
-rw-r--r--configure.in11
-rw-r--r--hl/test/H5srcdir_str.h.in (renamed from testpar/H5srcdir.h.in)0
-rw-r--r--hl/test/test_ds.c1
-rw-r--r--hl/test/test_image.c1
-rw-r--r--hl/test/test_lite.c1
-rw-r--r--hl/test/test_table.c1
-rw-r--r--perform/H5srcdir_str.h.in (renamed from test/H5srcdir.h.in)0
-rw-r--r--test/H5srcdir.h74
-rw-r--r--test/H5srcdir_str.h.in (renamed from perform/H5srcdir.h.in)0
-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/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
-rw-r--r--testpar/H5srcdir_str.h.in (renamed from hl/test/H5srcdir.h.in)0
-rw-r--r--windows/c++/test/H5srcdir.h22
-rw-r--r--windows/c++/test/H5srcdir_str.h (renamed from windows/tools/h5repack/H5srcdir.h)0
-rw-r--r--windows/hl/test/H5srcdir_str.h (renamed from windows/test/H5srcdir.h)0
-rw-r--r--windows/perform/H5srcdir_str.h (renamed from windows/perform/H5srcdir.h)0
-rw-r--r--windows/test/H5srcdir_str.h (renamed from windows/hl/test/H5srcdir.h)0
31 files changed, 107 insertions, 61 deletions
diff --git a/MANIFEST b/MANIFEST
index a5beb00..afbfd61 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -340,7 +340,7 @@
./c++/src/header_files/image001.jpg
./c++/src/header_files/image002.jpg
-./c++/test/H5srcdir.h.in
+./c++/test/H5srcdir_str.h.in
./c++/test/Makefile.am
./c++/test/Makefile.in
./c++/test/dsets.cpp
@@ -365,7 +365,7 @@
#------------------------------------------------------------------------------
./perform/COPYING
-./perform/H5srcdir.h.in
+./perform/H5srcdir_str.h.in
./perform/Makefile.am
./perform/Makefile.in
./perform/benchpar.c
@@ -790,7 +790,8 @@
./src/H5win32defs.h
./test/COPYING
-./test/H5srcdir.h.in
+./test/H5srcdir.h
+./test/H5srcdir_str.h.in
./test/Makefile.am
./test/Makefile.in
./test/app_ref.c
@@ -936,7 +937,7 @@
./test/testfiles/error_test_2
./testpar/COPYING
-./testpar/H5srcdir.h.in
+./testpar/H5srcdir_str.h.in
./testpar/Makefile.am
./testpar/Makefile.in
./testpar/t_cache.c
@@ -1031,7 +1032,6 @@
./tools/h5diff/testph5diff.sh
# h5repack sources
-./tools/h5repack/H5srcdir.h.in
./tools/h5repack/Makefile.am
./tools/h5repack/Makefile.in
./tools/h5repack/h5repack.sh.in
@@ -1711,7 +1711,7 @@
./hl/src/H5TBpublic.h
./hl/src/hdf5_hl.h
./hl/test/COPYING
-./hl/test/H5srcdir.h.in
+./hl/test/H5srcdir_str.h.in
./hl/test/Makefile.am
./hl/test/Makefile.in
./hl/test/dsdata.txt
@@ -1884,7 +1884,7 @@
./windows/c++/examples/writedatatestdll/writedatatestdll.vcproj
# C++ Tests
-./windows/c++/test/H5srcdir.h
+./windows/c++/test/H5srcdir_str.h
./windows/c++/test/checkcpptests.bat
./windows/c++/test/testhdf5_cpp/testhdf5_cpp.vcproj
./windows/c++/test/testhdf5_cppdll/testhdf5_cppdll.vcproj
@@ -2027,7 +2027,7 @@
./windows/hl/fortran/test/hl_test_table_fortrandll/hl_test_table_fortrandll.vfproj
# High-Level Library Tests
-./windows/hl/test/H5srcdir.h
+./windows/hl/test/H5srcdir_str.h
./windows/hl/test/checkhltests.bat
./windows/hl/test/hl_test_ds/hl_test_ds.vcproj
./windows/hl/test/hl_test_dsdll/hl_test_dsdll.vcproj
@@ -2054,7 +2054,7 @@
./windows/misc/typegen/h5tinit/h5tinit.vcproj
# Performance Tests
-./windows/perform/H5srcdir.h
+./windows/perform/H5srcdir_str.h
./windows/perform/checkperformtests.bat
./windows/perform/perf_serialdll/perf_serialdll.vcproj
./windows/perform/perf_serial/perf_serial.vcproj
@@ -2088,7 +2088,7 @@
./windows/src/H5pubconf.h
# Library Test Projects
-./windows/test/H5srcdir.h
+./windows/test/H5srcdir_str.h
./windows/test/checktests.bat
./windows/test/testerror.bat
./windows/test/app_ref/app_ref.vcproj
@@ -2218,7 +2218,6 @@
./windows/tools/h5lsdll/h5lsdll.vcproj
./windows/tools/h5mkgrp/h5mkgrp.vcproj
./windows/tools/h5mkgrp/testh5mkgrp.bat
-./windows/tools/h5repack/H5srcdir.h
./windows/tools/h5repack/h5repack.vcproj
./windows/tools/h5repack/h5repack.bat
./windows/tools/h5repackdll/h5repackdll.vcproj
diff --git a/c++/test/H5srcdir.h.in b/c++/test/H5srcdir.h.in
deleted file mode 100644
index d472124..0000000
--- a/c++/test/H5srcdir.h.in
+++ /dev/null
@@ -1,22 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * 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/tools/h5repack/H5srcdir.h.in b/c++/test/H5srcdir_str.h.in
index d472124..d472124 100644
--- a/tools/h5repack/H5srcdir.h.in
+++ b/c++/test/H5srcdir_str.h.in
diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp
index f82bb08..e63c9af 100644
--- a/c++/test/th5s.cpp
+++ b/c++/test/th5s.cpp
@@ -43,6 +43,7 @@
#endif
#include "h5cpputil.h" // C++ utilility header file
+#include "H5srcdir.h" // srcdir querying header file
const H5std_string TESTFILE("th5s.h5");
const H5std_string DATAFILE("th5s1.h5");
diff --git a/configure.in b/configure.in
index cee2d9d..67e4b9a 100644
--- a/configure.in
+++ b/configure.in
@@ -4051,13 +4051,13 @@ AC_CONFIG_FILES([src/libhdf5.settings
test/Makefile
test/testcheck_version.sh
test/testerror.sh
- test/H5srcdir.h
+ test/H5srcdir_str.h
test/testlibinfo.sh
testpar/Makefile
- testpar/H5srcdir.h
+ testpar/H5srcdir_str.h
testpar/testph5.sh
perform/Makefile
- perform/H5srcdir.h
+ perform/H5srcdir_str.h
tools/Makefile
tools/h5dump/Makefile
tools/h5dump/testh5dump.sh
@@ -4067,7 +4067,6 @@ AC_CONFIG_FILES([src/libhdf5.settings
tools/h5diff/Makefile
tools/h5jam/Makefile
tools/h5jam/testh5jam.sh
- tools/h5repack/H5srcdir.h
tools/h5repack/Makefile
tools/h5repack/h5repack.sh
tools/h5ls/Makefile
@@ -4084,7 +4083,7 @@ AC_CONFIG_FILES([src/libhdf5.settings
c++/src/Makefile
c++/src/h5c++
c++/test/Makefile
- c++/test/H5srcdir.h
+ c++/test/H5srcdir_str.h
c++/examples/Makefile
c++/examples/testh5c++.sh
fortran/Makefile
@@ -4097,7 +4096,7 @@ AC_CONFIG_FILES([src/libhdf5.settings
hl/Makefile
hl/src/Makefile
hl/test/Makefile
- hl/test/H5srcdir.h
+ hl/test/H5srcdir_str.h
hl/tools/Makefile
hl/tools/gif2h5/Makefile
hl/examples/Makefile
diff --git a/testpar/H5srcdir.h.in b/hl/test/H5srcdir_str.h.in
index d472124..d472124 100644
--- a/testpar/H5srcdir.h.in
+++ b/hl/test/H5srcdir_str.h.in
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index e3d7fe4..d1705ec 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <string.h>
#include "h5hltest.h"
+#include "H5srcdir.h"
#include "H5DSpublic.h"
#include "H5LTpublic.h"
#include "H5IMpublic.h"
diff --git a/hl/test/test_image.c b/hl/test/test_image.c
index d87946c..1332841 100644
--- a/hl/test/test_image.c
+++ b/hl/test/test_image.c
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <string.h>
#include "h5hltest.h"
+#include "H5srcdir.h"
#include "H5LTpublic.h"
#include "H5IMpublic.h"
#include "pal_rgb.h"
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c
index 27da0ab..b538550 100644
--- a/hl/test/test_lite.c
+++ b/hl/test/test_lite.c
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <string.h>
#include "h5hltest.h"
+#include "H5srcdir.h"
#include "H5LTpublic.h"
#define FILE_NAME "test_lite1.h5"
diff --git a/hl/test/test_table.c b/hl/test/test_table.c
index 0e87a7f..0fc4c84 100644
--- a/hl/test/test_table.c
+++ b/hl/test/test_table.c
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <string.h>
#include "h5hltest.h"
+#include "H5srcdir.h"
#include "H5TBpublic.h"
#define TEST_FILE_BE "test_table_be.hdf5"
diff --git a/test/H5srcdir.h.in b/perform/H5srcdir_str.h.in
index d472124..d472124 100644
--- a/test/H5srcdir.h.in
+++ b/perform/H5srcdir_str.h.in
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/perform/H5srcdir.h.in b/test/H5srcdir_str.h.in
index d472124..d472124 100644
--- a/perform/H5srcdir.h.in
+++ b/test/H5srcdir_str.h.in
diff --git a/test/cross_read.c b/test/cross_read.c
index 6ce38f2..6b2badf 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 c17e90c..0bf237b 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 24cd85b..7fd344e 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 25c8bd1..81856de 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/links.c b/test/links.c
index 18c4caa..afd5872 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 79c539c..cc04e42 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 d540117..439cfb1 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 69b61ea..5bccf6e 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 83528ff..f191c95 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 a981720..3a4674f 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 d999920..2de867b 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 728200e..d65f066 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 */
diff --git a/hl/test/H5srcdir.h.in b/testpar/H5srcdir_str.h.in
index d472124..d472124 100644
--- a/hl/test/H5srcdir.h.in
+++ b/testpar/H5srcdir_str.h.in
diff --git a/windows/c++/test/H5srcdir.h b/windows/c++/test/H5srcdir.h
deleted file mode 100644
index 4d32264..0000000
--- a/windows/c++/test/H5srcdir.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * 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 = ".";
-
diff --git a/windows/tools/h5repack/H5srcdir.h b/windows/c++/test/H5srcdir_str.h
index 4d32264..4d32264 100644
--- a/windows/tools/h5repack/H5srcdir.h
+++ b/windows/c++/test/H5srcdir_str.h
diff --git a/windows/test/H5srcdir.h b/windows/hl/test/H5srcdir_str.h
index 4d32264..4d32264 100644
--- a/windows/test/H5srcdir.h
+++ b/windows/hl/test/H5srcdir_str.h
diff --git a/windows/perform/H5srcdir.h b/windows/perform/H5srcdir_str.h
index 4d32264..4d32264 100644
--- a/windows/perform/H5srcdir.h
+++ b/windows/perform/H5srcdir_str.h
diff --git a/windows/hl/test/H5srcdir.h b/windows/test/H5srcdir_str.h
index 4d32264..4d32264 100644
--- a/windows/hl/test/H5srcdir.h
+++ b/windows/test/H5srcdir_str.h