summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-09-24 11:25:37 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-09-24 11:25:37 (GMT)
commitf1360e4d06c6e75a3ee51f5e79973aaed9b53800 (patch)
treec67bde83e84f7cb9a1e8c2301aeff05d9f789091 /test
parentdfa5cb68c0582a402b520deba65a7fef12ee740e (diff)
downloadhdf5-f1360e4d06c6e75a3ee51f5e79973aaed9b53800.zip
hdf5-f1360e4d06c6e75a3ee51f5e79973aaed9b53800.tar.gz
hdf5-f1360e4d06c6e75a3ee51f5e79973aaed9b53800.tar.bz2
[svn-r17515] Description:
Bring r17496:17514 from trunk to revise_chunks branch 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/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) 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.5.8 (amazon) in debug mode Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am2
-rw-r--r--test/Makefile.in9
-rw-r--r--test/testlibinfo.sh.in128
3 files changed, 135 insertions, 4 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 81c7362..d52606a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -24,7 +24,7 @@ include $(top_srcdir)/config/commence.am
INCLUDES=-I$(top_srcdir)/src -I$(top_builddir)/src
# Test script for error_test and err_compat
-TEST_SCRIPT = testerror.sh $(srcdir)/testswmr.sh
+TEST_SCRIPT = testerror.sh testlibinfo.sh $(srcdir)/testswmr.sh
check_SCRIPTS = $(TEST_SCRIPT)
SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT)
diff --git a/test/Makefile.in b/test/Makefile.in
index 406f02c..7d75ec1 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -53,7 +53,8 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/testerror.sh.in $(top_srcdir)/config/commence.am \
+ $(srcdir)/testerror.sh.in $(srcdir)/testlibinfo.sh.in \
+ $(top_srcdir)/config/commence.am \
$(top_srcdir)/config/conclude.am COPYING
bin_PROGRAMS = swmr_generator$(EXEEXT) swmr_reader$(EXEEXT) \
swmr_writer$(EXEEXT)
@@ -68,7 +69,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 = testerror.sh
+CONFIG_CLEAN_FILES = testerror.sh testlibinfo.sh
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libh5test_la_LIBADD =
@@ -679,7 +680,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog cmpd_dset.h5 \
INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src
# Test script for error_test and err_compat
-TEST_SCRIPT = testerror.sh $(srcdir)/testswmr.sh
+TEST_SCRIPT = testerror.sh testlibinfo.sh $(srcdir)/testswmr.sh
check_SCRIPTS = $(TEST_SCRIPT)
SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT)
@@ -786,6 +787,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__aclocal_m4_deps):
testerror.sh: $(top_builddir)/config.status $(srcdir)/testerror.sh.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)/$@
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
diff --git a/test/testlibinfo.sh.in b/test/testlibinfo.sh.in
new file mode 100644
index 0000000..97fb59d
--- /dev/null
+++ b/test/testlibinfo.sh.in
@@ -0,0 +1,128 @@
+#! /bin/sh
+#
+# 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.
+
+
+#
+# Tests for the embedded library information feature.
+# Part 1:
+# Verify the HDF5 library does contains an exact copy of the content of the
+# libhdf5.settings file.
+# Part 2:
+# If executable is linked with the static hdf5 library (how to determine?),
+# verify an executable indeed contains an exact copy of hte content of the
+# libhdf5.settings file.
+#
+# Programmer: Albert Cheng
+# Sep 18, 2009
+
+# Determine the configure options of the hdf5 library and executables.
+
+Shared_Lib=@enable_shared@
+Static_Lib=@enable_static@
+Static_exec=@STATIC_EXEC@
+
+
+# Print a line-line message left justified in a field of 70 characters.
+#
+LINEMSG() {
+ SPACES=" "
+ echo "Check file $* $SPACES" | cut -c1-70 | tr -d '\012'
+}
+
+
+# Print a "SKIP" message
+SKIP() {
+ LINEMSG $*
+ echo " -SKIP-"
+}
+
+# Function definitions
+CHECK_LIBINFO(){
+ LINEMSG $1
+ if strings $1 | grep "SUMMARY OF THE HDF5 CONFIGURATION" > /dev/null; then
+ echo " PASSED"
+ else
+ echo " FAILED"
+ nerrors=`expr $nerrors + 1`
+ fi
+}
+
+
+# MAIN Body
+nerrors=0
+H5_HAVE_EMBEDDED_LIBINFO=`grep '#define H5_HAVE_EMBEDDED_LIBINFO ' ../src/H5pubconf.h`
+
+# Skip the rest if embedded-libinfo is not enabled.
+if [ -z "$H5_HAVE_EMBEDDED_LIBINFO" ]; then
+ echo "embedded-libinfo is not enabled. Test skipped."
+ exit 0
+fi
+
+# The location of HDF library file(s) depends on whether shared lib is
+# built too.
+if [ -n $Shared_Lib ]; then
+ h5libdir=../src/.libs
+else
+ h5libdir=../src
+fi
+
+# Different OS uses different naming for shared libs.
+case `uname -s` in
+ Darwin) # MacOS
+ shlibsuffix=.dylib
+ break
+ ;;
+ *) # default
+ shlibsuffix=.so
+ break
+ ;;
+esac
+
+h5libsettings=../src/libhdf5.settings
+
+# Part 1:
+# Verify the HDF5 library does contains an exact copy of the content of the
+# libhdf5.settings file.
+# Check dynamic library file if built.
+if [ x-$Shared_Lib = x-yes ]; then
+ CHECK_LIBINFO ${h5libdir}/libhdf5${shlibsuffix}
+else
+ SKIP ${h5libdir}/libhdf5${shlibsuffix}
+fi
+
+# Though rare, libhdf5.a may not have been built.
+if [ x-$Static_Lib = x-yes ]; then
+ CHECK_LIBINFO ${h5libdir}/libhdf5.a
+else
+ SKIP ${h5libdir}/libhdf5.a
+fi
+
+# Check if executables has the lib information only if shared lib is not
+# built or static-exec is used. (Don't care static-exec since it affects
+# tools binary only.)
+if [ x-$Shared_Lib != x-yes ]; then
+ CHECK_LIBINFO testhdf5
+else
+ SKIP testhdf5
+fi
+
+
+if [ $nerrors -gt 0 ]; then
+ echo "***$nerrors errors encountered***"
+ exit 1
+else
+ echo "No error encountered"
+ exit 0
+fi