summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.in2
-rw-r--r--c++/Makefile.in2
-rw-r--r--c++/config/conclude.in167
-rw-r--r--config/conclude.in200
-rw-r--r--fortran/Makefile.in2
-rw-r--r--fortran/config/conclude.in196
-rwxr-xr-xhl/Makefile.in2
-rw-r--r--hl/tools/Makefile.in2
-rw-r--r--tools/Makefile.in2
9 files changed, 402 insertions, 173 deletions
diff --git a/Makefile.in b/Makefile.in
index 09bc005..fbd1afd 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -68,7 +68,7 @@ SUBDIRS=src test @TESTPARALLEL@ tools @subdirs@ @HL@
## programs and C compilers. At the other extreme, the GNU
## make used in combination with gcc will maintain dependency
## information automatically.
-lib progs check check-s check-p test _test:
+lib progs check check-s check-p check-clean test _test:
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done
diff --git a/c++/Makefile.in b/c++/Makefile.in
index 485c240..5277d13 100644
--- a/c++/Makefile.in
+++ b/c++/Makefile.in
@@ -79,7 +79,7 @@ SUBDIRS=src test
## programs and C compilers. At the other extreme, the GNU
## make used in combination with gcc will maintain dependency
## information automatically.
-lib progs check check-s check-p test _test uninstall:
+lib progs check check-s check-p check-clean test _test uninstall:
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done
diff --git a/c++/config/conclude.in b/c++/config/conclude.in
index 390a37f..89c2086 100644
--- a/c++/config/conclude.in
+++ b/c++/config/conclude.in
@@ -56,41 +56,126 @@ check-p: tests
$(MAKE) _check-p
@echo "===Parallel C++ tests in `echo ${PWD} | sed -e s:.*/::` ended `date`==="
-## Actual execution of sequtial tests.
-_check-s: tests
- @for test in $(TEST_PROGS) dummy; do \
- if test $$test != dummy; then \
- echo ""; \
- echo "====================================="; \
- echo "C++ API: Testing $$test $(TEST_FLAGS)"; \
- echo "====================================="; \
- echo ""; \
- srcdir="$(srcdir)" \
- $(TIME) ./$$test $(TEST_FLAGS) || \
- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
- break; \
- fi; \
- done; \
- test $$test = dummy || false
- @for test in $(TEST_SCRIPTS) dummy; do \
- if test $$test != dummy; then \
- echo ""; \
- echo "====================================="; \
- echo "C++ API: Testing $$test $(TEST_FLAGS)"; \
- echo "====================================="; \
- echo ""; \
- srcdir="$(srcdir)" \
- $(TIME) /bin/sh $$test $(TEST_FLAGS) || \
- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
- break; \
- fi; \
- done; \
- test $$test = dummy || false
+## setup for non-repeating tests.
+TEST_PROG_CHKEXE=$(TEST_PROGS:=.chkexe_)
+TEST_PROG_PARA_CHKEXE=$(TEST_PROGS_PARA:=.chkexe_)
+TEST_SCRIPT_CHKSH=$(TEST_SCRIPTS:=.chkexe_)
+TEST_SCRIPT_PARA_CHKSH=$(TEST_SCRIPTS_PARA:=.chkexe_)
+# .chkexe files are used to mark tests that have run successfully.
+# .chklog files are output from those tests.
+# *.clog are from the MPE option.
+CHECK_CLEANFILES=*.chkexe *.chklog *.clog
-## Actual execution of parallel tests.
-## No parallel C++ tests yet. Just a dummy target.
-_check-p: tests
+_check-s: $(TEST_PROG_CHKEXE) $(TEST_SCRIPT_CHKSH)
+# The dummy.chkexe here prevents the target from being
+# empty if there are no tests in the current directory.
+# $${log} is the log file.
+# $${tname} is the name of test.
+$(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
+ @if test "X$@" != "X.chkexe_" && test "X$@" != "Xdummy.chkexe_"; then \
+ tname=$(@:.chkexe_=)$(EXEEXT);\
+ log=$(@:.chkexe_=.chklog); \
+ echo "============================"; \
+ if $(top_srcdir)/bin/newer $(@:.chkexe_=.chkexe) $${tname}; then \
+ echo "No need to test $${tname} again."; \
+ else \
+ echo "============================" > $${log}; \
+ if test "X$(HDF_FORTRAN)" = "Xyes"; then \
+ echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ elif test "X$(HDF_CXX)" = "Xyes"; then \
+ echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\
+ else \
+ echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ fi; \
+ echo "============================" >> $${log}; \
+ srcdir="$(srcdir)" \
+ $(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \
+ && touch $(@:.chkexe_=.chkexe) || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ (cat $${log} && false) || exit 1; \
+ echo "" >> $${log}; \
+ echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \
+ echo "============================" >> $${log}; \
+ echo "Finished testing $${tname} $(TEST_FLAGS)"; \
+ cat $${log}; \
+ fi; \
+ fi
+
+# The dummysh.chkexe here prevents the target from being
+# empty if there are no tests in the current directory.
+# $${log} is the log file.
+# $${tname} is the name of test.
+$(TEST_SCRIPT_CHKSH) $(TEST_SCRIPT_PARA_CHKSH) dummysh.chkexe_:
+ @if test "X$@" != "X.chkexe_" && test "X$@" != "Xdummysh.chkexe_"; then \
+ cmd=$(@:.chkexe_=);\
+ tname=`basename $$cmd`;\
+ chkname=`basename $(@:.chkexe_=.chkexe)`;\
+ log=`basename $(@:.chkexe_=.chklog)`; \
+ echo "============================"; \
+ if $(top_srcdir)/bin/newer $${chkname} $$cmd $(SCRIPT_DEPEND); then \
+ echo "No need to test $${tname} again."; \
+ else \
+ echo "============================" > $${log}; \
+ if test "X$(HDF_FORTRAN)" = "Xyes"; then \
+ echo "Fortran API: Testing $${tname} $(TEST_FLAGS)"; \
+ echo "Fortran API: $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ elif test "X$(HDF_CXX)" = "Xyes"; then \
+ echo "C++ API: Testing $${tname} $(TEST_FLAGS)"; \
+ echo "C++ API: $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ else \
+ echo "Testing $${tname} $(TEST_FLAGS)"; \
+ echo "$${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ fi; \
+ echo "============================" >> $${log}; \
+ RUNSERIAL="$(RUNSERIAL)" RUNPARALLEL="$(RUNPARALLEL)" \
+ srcdir="$(srcdir)" \
+ $(TIME) $(SHELL) $$cmd $(TEST_FLAGS) >> $${log} 2>&1 \
+ && touch $${chkname} || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ (cat $${log} && false) || exit 1; \
+ echo "" >> $${log}; \
+ echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \
+ echo "============================" >> $${log}; \
+ echo "Finished testing $${tname} $(TEST_FLAGS)"; \
+ cat $${log}; \
+ fi; \
+ echo "============================"; \
+ fi
+
+# Actual execution of check-p.
+# (no parallel tests for C++ API yet.)
+_check-p: $(LIB) $(PROGS) $(TESTS)
+ @if test -n "$(TEST_PROGS_PARA)$(TEST_SCRIPTS_PARA)"; then \
+ echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \
+ fi
+ @if test -n "$(TEST_PROGS_PARA)"; then \
+ echo "**** Hint ****"; \
+ echo "Parallel test files reside in the current directory" \
+ "by default."; \
+ echo "Set HDF5_PARAPREFIX to use another directory. E.g.,"; \
+ echo " HDF5_PARAPREFIX=/PFS/user/me"; \
+ echo " export HDF5_PARAPREFIX"; \
+ echo " make check"; \
+ echo "**** end of Hint ****"; \
+ fi
+ @for test in $(TEST_PROGS_PARA) dummy; do \
+ if test $$test != dummy; then \
+ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \
+ RUNTESTS="$(RUNPARALLEL)" || exit 1; \
+ fi; \
+ done
+ @for test in $(TEST_SCRIPTS_PARA) dummy; do \
+ if test $$test != dummy; then \
+ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ || exit 1; \
+ fi; \
+ done
+ @if test -n "$(TEST_PROGS_PARA)$(TEST_SCRIPTS_PARA)"; then \
+ echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` ended `date`===";\
+ fi
## Make installation directories directories if they don't exist.
$(libdir):
@@ -157,10 +242,24 @@ uninstall:
fi; \
done
+# General rule for recursive cleaning targets. Like the rule above,
+# but doesn't require building BUILT_SOURCES.
+check-clean:
+ @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1;
+ @for d in X $(SUBDIRS); do \
+ if test $$d != X && test $$d != .; then \
+ (set -x; cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
+ fi; \
+ done
+
+# clean up files generated by tests so they can be re-run.
+build-check-clean:
+ $(RM) -rf $(CHECK_CLEANFILES)
+
## Removes temporary files without removing the final target files. That is,
## remove things like object files but not libraries or executables.
##
-mostlyclean:
+mostlyclean: build-check-clean
@if test -n "$(LIB_OBJ)"; then \
$(RM) $(LIB_OBJ) $(LIB_OBJ:.lo=.o); \
fi
diff --git a/config/conclude.in b/config/conclude.in
index 725f2fd..0568f13 100644
--- a/config/conclude.in
+++ b/config/conclude.in
@@ -67,75 +67,126 @@ check-p: tests
$(MAKE) _check-p
@echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` ended `date`==="
-## Actual execution of sequtial tests.
-_check-s: tests
- @for test in $(TEST_PROGS) dummy; do \
- if test $$test != dummy; then \
- echo "============================"; \
- echo "Testing $$test $(TEST_FLAGS)"; \
- echo "============================"; \
- srcdir="$(srcdir)" \
- $(TIME) $(RUNTEST) ./$$test $(TEST_FLAGS) || \
- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
- break; \
- echo ""; \
- fi; \
- done; \
- test $$test = dummy || false
- @for test in $(TEST_SCRIPTS) dummy; do \
- if test $$test != dummy; then \
- echo "============================"; \
- echo "Testing $$test $(TEST_FLAGS)"; \
- echo "============================"; \
+## setup for non-repeating tests.
+TEST_PROG_CHKEXE=$(TEST_PROGS:=.chkexe_)
+TEST_PROG_PARA_CHKEXE=$(TEST_PROGS_PARA:=.chkexe_)
+TEST_SCRIPT_CHKSH=$(TEST_SCRIPTS:=.chkexe_)
+TEST_SCRIPT_PARA_CHKSH=$(TEST_SCRIPTS_PARA:=.chkexe_)
+# .chkexe files are used to mark tests that have run successfully.
+# .chklog files are output from those tests.
+# *.clog are from the MPE option.
+CHECK_CLEANFILES=*.chkexe *.chklog *.clog
+
+_check-s: $(TEST_PROG_CHKEXE) $(TEST_SCRIPT_CHKSH)
+
+# The dummy.chkexe here prevents the target from being
+# empty if there are no tests in the current directory.
+# $${log} is the log file.
+# $${tname} is the name of test.
+$(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
+ @if test "X$@" != "X.chkexe_" && test "X$@" != "Xdummy.chkexe_"; then \
+ tname=$(@:.chkexe_=)$(EXEEXT);\
+ log=$(@:.chkexe_=.chklog); \
+ echo "============================"; \
+ if $(top_srcdir)/bin/newer $(@:.chkexe_=.chkexe) $${tname}; then \
+ echo "No need to test $${tname} again."; \
+ else \
+ echo "============================" > $${log}; \
+ if test "X$(HDF_FORTRAN)" = "Xyes"; then \
+ echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ elif test "X$(HDF_CXX)" = "Xyes"; then \
+ echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\
+ else \
+ echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ fi; \
+ echo "============================" >> $${log}; \
+ srcdir="$(srcdir)" \
+ $(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \
+ && touch $(@:.chkexe_=.chkexe) || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ (cat $${log} && false) || exit 1; \
+ echo "" >> $${log}; \
+ echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \
+ echo "============================" >> $${log}; \
+ echo "Finished testing $${tname} $(TEST_FLAGS)"; \
+ cat $${log}; \
+ fi; \
+ fi
+
+# The dummysh.chkexe here prevents the target from being
+# empty if there are no tests in the current directory.
+# $${log} is the log file.
+# $${tname} is the name of test.
+$(TEST_SCRIPT_CHKSH) $(TEST_SCRIPT_PARA_CHKSH) dummysh.chkexe_:
+ @if test "X$@" != "X.chkexe_" && test "X$@" != "Xdummysh.chkexe_"; then \
+ cmd=$(@:.chkexe_=);\
+ tname=`basename $$cmd`;\
+ chkname=`basename $(@:.chkexe_=.chkexe)`;\
+ log=`basename $(@:.chkexe_=.chklog)`; \
+ echo "============================"; \
+ if $(top_srcdir)/bin/newer $${chkname} $$cmd $(SCRIPT_DEPEND); then \
+ echo "No need to test $${tname} again."; \
+ else \
+ echo "============================" > $${log}; \
+ if test "X$(HDF_FORTRAN)" = "Xyes"; then \
+ echo "Fortran API: Testing $${tname} $(TEST_FLAGS)"; \
+ echo "Fortran API: $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ elif test "X$(HDF_CXX)" = "Xyes"; then \
+ echo "C++ API: Testing $${tname} $(TEST_FLAGS)"; \
+ echo "C++ API: $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ else \
+ echo "Testing $${tname} $(TEST_FLAGS)"; \
+ echo "$${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ fi; \
+ echo "============================" >> $${log}; \
RUNSERIAL="$(RUNSERIAL)" RUNPARALLEL="$(RUNPARALLEL)" \
- srcdir="$(srcdir)" \
- $(TIME) /bin/sh $$test $(TEST_FLAGS) || \
- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
- break; \
- echo ""; \
- fi; \
- done; \
- test $$test = dummy || false
-
-## Actual execution of parallel tests.
-_check-p: tests
- @if test -n "$(TEST_PROGS_PARA)"; then \
- echo "**** Hint ****"; \
- echo "Parallel test files reside in the current directory" \
- "by default."; \
- echo "Set HDF5_PARAPREFIX to use another directory. E.g.,"; \
- echo " HDF5_PARAPREFIX=/PFS/user/me"; \
- echo " export HDF5_PARAPREFIX"; \
- echo " make check"; \
- echo "**** end of Hint ****"; \
+ srcdir="$(srcdir)" \
+ $(TIME) $(SHELL) $$cmd $(TEST_FLAGS) >> $${log} 2>&1 \
+ && touch $${chkname} || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ (cat $${log} && false) || exit 1; \
+ echo "" >> $${log}; \
+ echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \
+ echo "============================" >> $${log}; \
+ echo "Finished testing $${tname} $(TEST_FLAGS)"; \
+ cat $${log}; \
+ fi; \
+ echo "============================"; \
+ fi
+
+# Actual execution of check-p.
+_check-p: $(LIB) $(PROGS) $(TESTS)
+ @if test -n "$(TEST_PROGS_PARA)$(TEST_SCRIPTS_PARA)"; then \
+ echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \
+ fi
+ @if test -n "$(TEST_PROGS_PARA)"; then \
+ echo "**** Hint ****"; \
+ echo "Parallel test files reside in the current directory" \
+ "by default."; \
+ echo "Set HDF5_PARAPREFIX to use another directory. E.g.,"; \
+ echo " HDF5_PARAPREFIX=/PFS/user/me"; \
+ echo " export HDF5_PARAPREFIX"; \
+ echo " make check"; \
+ echo "**** end of Hint ****"; \
fi
@for test in $(TEST_PROGS_PARA) dummy; do \
- if test $$test != dummy; then \
- echo "============================"; \
- echo "Testing $$test $(TEST_FLAGS)"; \
- echo "============================"; \
- srcdir="$(srcdir)" \
- $(TIME) $(RUNPARALLEL) ./$$test $(TEST_FLAGS) || \
- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
- break; \
- echo ""; \
- fi; \
- done; \
- test $$test = dummy || false
- @for test in $(TEST_SCRIPTS_PARA) dummy; do \
- if test $$test != dummy; then \
- echo "============================"; \
- echo "Testing $$test $(TEST_FLAGS)"; \
- echo "============================"; \
- RUNSERIAL="$(RUNSERIAL)" RUNPARALLEL="$(RUNPARALLEL)" \
- srcdir="$(srcdir)" \
- $(TIME) /bin/sh $$test $(TEST_FLAGS) || \
- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
- break; \
- echo ""; \
- fi; \
- done; \
- test $$test = dummy || false
+ if test $$test != dummy; then \
+ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \
+ RUNTESTS="$(RUNPARALLEL)" || exit 1; \
+ fi; \
+ done
+ @for test in $(TEST_SCRIPTS_PARA) dummy; do \
+ if test $$test != dummy; then \
+ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ || exit 1; \
+ fi; \
+ done
+ @if test -n "$(TEST_PROGS_PARA)$(TEST_SCRIPTS_PARA)"; then \
+ echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` ended `date`===";\
+ fi
+
## Run test with different Virtual File Driver
check-vfd:
@@ -144,6 +195,7 @@ check-vfd:
echo "============================"; \
echo "Testing Virtual File Driver $$vfd"; \
echo "============================"; \
+ $(MAKE) $(AM_MAKEFLAGS) check-clean || exit 1; \
HDF5_DRIVER=$$vfd $(MAKE) check; \
fi; \
done
@@ -292,10 +344,24 @@ uninstall-doc:
set -x; cd $(DOCDIR) && $(RM) $(PUB_SUBDOCS); \
fi
+# General rule for recursive cleaning targets. Like the rule above,
+# but doesn't require building BUILT_SOURCES.
+check-clean:
+ @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1;
+ @for d in X $(SUBDIRS); do \
+ if test $$d != X && test $$d != .; then \
+ (set -x; cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
+ fi; \
+ done
+
+# clean up files generated by tests so they can be re-run.
+build-check-clean:
+ $(RM) -rf $(CHECK_CLEANFILES)
+
## Removes temporary files without removing the final target files. That is,
## remove things like object files but not libraries or executables.
##
-mostlyclean:
+mostlyclean: build-check-clean
@for d in X $(SUBDIRS); do \
if test $$d != X; then \
(set -x; cd $$d; $(MAKE) $@) || exit 1; \
diff --git a/fortran/Makefile.in b/fortran/Makefile.in
index 6b62fe6..a45350e 100644
--- a/fortran/Makefile.in
+++ b/fortran/Makefile.in
@@ -74,7 +74,7 @@ SUBDIRS=src test @TESTPARALLEL@
## programs and C compilers. At the other extreme, the GNU
## make used in combination with gcc will maintain dependency
## information automatically.
-lib progs check check-s check-p test _test uninstall:
+lib progs check check-s check-p check-clean test _test uninstall:
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done
diff --git a/fortran/config/conclude.in b/fortran/config/conclude.in
index 7d3dc6d..0cb2687 100644
--- a/fortran/config/conclude.in
+++ b/fortran/config/conclude.in
@@ -52,75 +52,125 @@ check-p: tests
$(MAKE) _check-p
@echo "===Parallel Fortran tests in `echo ${PWD} | sed -e s:.*/::` ended `date`==="
-## Actual execution of sequtial tests.
-_check-s: tests
- @for test in $(TEST_PROGS) dummy; do \
- if test $$test != dummy; then \
- echo "============================"; \
- echo "Testing $$test $(TEST_FLAGS)"; \
- echo "============================"; \
- srcdir="$(srcdir)" \
- $(TIME) $(RUNTEST) ./$$test $(TEST_FLAGS) || \
- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
- break; \
- echo ""; \
- fi; \
- done; \
- test $$test = dummy || false
- @for test in $(TEST_SCRIPTS) dummy; do \
- if test $$test != dummy; then \
- echo "============================"; \
- echo "Testing $$test $(TEST_FLAGS)"; \
- echo "============================"; \
+## setup for non-repeating tests.
+TEST_PROG_CHKEXE=$(TEST_PROGS:=.chkexe_)
+TEST_PROG_PARA_CHKEXE=$(TEST_PROGS_PARA:=.chkexe_)
+TEST_SCRIPT_CHKSH=$(TEST_SCRIPTS:=.chkexe_)
+TEST_SCRIPT_PARA_CHKSH=$(TEST_SCRIPTS_PARA:=.chkexe_)
+# .chkexe files are used to mark tests that have run successfully.
+# .chklog files are output from those tests.
+# *.clog are from the MPE option.
+CHECK_CLEANFILES=*.chkexe *.chklog *.clog
+
+_check-s: $(TEST_PROG_CHKEXE) $(TEST_SCRIPT_CHKSH)
+
+# The dummy.chkexe here prevents the target from being
+# empty if there are no tests in the current directory.
+# $${log} is the log file.
+# $${tname} is the name of test.
+$(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_:
+ @if test "X$@" != "X.chkexe_" && test "X$@" != "Xdummy.chkexe_"; then \
+ tname=$(@:.chkexe_=)$(EXEEXT);\
+ log=$(@:.chkexe_=.chklog); \
+ echo "============================"; \
+ if $(top_srcdir)/bin/newer $(@:.chkexe_=.chkexe) $${tname}; then \
+ echo "No need to test $${tname} again."; \
+ else \
+ echo "============================" > $${log}; \
+ if test "X$(HDF_FORTRAN)" = "Xyes"; then \
+ echo "Fortran API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "Fortran API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ elif test "X$(HDF_CXX)" = "Xyes"; then \
+ echo "C++ API: Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "C++ API: $(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log};\
+ else \
+ echo "Testing $(HDF5_DRIVER) $${tname} $(TEST_FLAGS)"; \
+ echo "$(HDF5_DRIVER) $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ fi; \
+ echo "============================" >> $${log}; \
+ srcdir="$(srcdir)" \
+ $(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \
+ && touch $(@:.chkexe_=.chkexe) || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ (cat $${log} && false) || exit 1; \
+ echo "" >> $${log}; \
+ echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \
+ echo "============================" >> $${log}; \
+ echo "Finished testing $${tname} $(TEST_FLAGS)"; \
+ cat $${log}; \
+ fi; \
+ fi
+
+# The dummysh.chkexe here prevents the target from being
+# empty if there are no tests in the current directory.
+# $${log} is the log file.
+# $${tname} is the name of test.
+$(TEST_SCRIPT_CHKSH) $(TEST_SCRIPT_PARA_CHKSH) dummysh.chkexe_:
+ @if test "X$@" != "X.chkexe_" && test "X$@" != "Xdummysh.chkexe_"; then \
+ cmd=$(@:.chkexe_=);\
+ tname=`basename $$cmd`;\
+ chkname=`basename $(@:.chkexe_=.chkexe)`;\
+ log=`basename $(@:.chkexe_=.chklog)`; \
+ echo "============================"; \
+ if $(top_srcdir)/bin/newer $${chkname} $$cmd $(SCRIPT_DEPEND); then \
+ echo "No need to test $${tname} again."; \
+ else \
+ echo "============================" > $${log}; \
+ if test "X$(HDF_FORTRAN)" = "Xyes"; then \
+ echo "Fortran API: Testing $${tname} $(TEST_FLAGS)"; \
+ echo "Fortran API: $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ elif test "X$(HDF_CXX)" = "Xyes"; then \
+ echo "C++ API: Testing $${tname} $(TEST_FLAGS)"; \
+ echo "C++ API: $${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ else \
+ echo "Testing $${tname} $(TEST_FLAGS)"; \
+ echo "$${tname} $(TEST_FLAGS) Test Log" >> $${log}; \
+ fi; \
+ echo "============================" >> $${log}; \
RUNSERIAL="$(RUNSERIAL)" RUNPARALLEL="$(RUNPARALLEL)" \
- srcdir="$(srcdir)" \
- $(TIME) /bin/sh $$test $(TEST_FLAGS) || \
- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
- break; \
- echo ""; \
- fi; \
- done; \
- test $$test = dummy || false
-
-## Actual execution of parallel tests.
-_check-p: tests
- @if test -n "$(TEST_PROGS_PARA)"; then \
- echo "**** Hint ****"; \
- echo "Parallel test files reside in the current directory" \
- "by default."; \
- echo "Set HDF5_PARAPREFIX to use another directory. E.g.,"; \
- echo " HDF5_PARAPREFIX=/PFS/user/me"; \
- echo " export HDF5_PARAPREFIX"; \
- echo " make check"; \
- echo "**** end of Hint ****"; \
+ srcdir="$(srcdir)" \
+ $(TIME) $(SHELL) $$cmd $(TEST_FLAGS) >> $${log} 2>&1 \
+ && touch $${chkname} || \
+ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
+ (cat $${log} && false) || exit 1; \
+ echo "" >> $${log}; \
+ echo "Finished testing $${tname} $(TEST_FLAGS)" >> $${log}; \
+ echo "============================" >> $${log}; \
+ echo "Finished testing $${tname} $(TEST_FLAGS)"; \
+ cat $${log}; \
+ fi; \
+ echo "============================"; \
+ fi
+
+# Actual execution of check-p.
+_check-p: $(LIB) $(PROGS) $(TESTS)
+ @if test -n "$(TEST_PROGS_PARA)$(TEST_SCRIPTS_PARA)"; then \
+ echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` begin `date`==="; \
+ fi
+ @if test -n "$(TEST_PROGS_PARA)"; then \
+ echo "**** Hint ****"; \
+ echo "Parallel test files reside in the current directory" \
+ "by default."; \
+ echo "Set HDF5_PARAPREFIX to use another directory. E.g.,"; \
+ echo " HDF5_PARAPREFIX=/PFS/user/me"; \
+ echo " export HDF5_PARAPREFIX"; \
+ echo " make check"; \
+ echo "**** end of Hint ****"; \
fi
@for test in $(TEST_PROGS_PARA) dummy; do \
- if test $$test != dummy; then \
- echo "============================"; \
- echo "Testing $$test $(TEST_FLAGS)"; \
- echo "============================"; \
- srcdir="$(srcdir)" \
- $(TIME) $(RUNPARALLEL) ./$$test $(TEST_FLAGS) || \
- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
- break; \
- echo ""; \
- fi; \
- done; \
- test $$test = dummy || false
+ if test $$test != dummy; then \
+ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \
+ RUNTESTS="$(RUNPARALLEL)" || exit 1; \
+ fi; \
+ done
@for test in $(TEST_SCRIPTS_PARA) dummy; do \
- if test $$test != dummy; then \
- echo "============================"; \
- echo "Testing $$test $(TEST_FLAGS)"; \
- echo "============================"; \
- RUNSERIAL="$(RUNSERIAL)" RUNPARALLEL="$(RUNPARALLEL)" \
- srcdir="$(srcdir)" \
- $(TIME) /bin/sh $$test $(TEST_FLAGS) || \
- (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
- break; \
- echo ""; \
- fi; \
- done; \
- test $$test = dummy || false
+ if test $$test != dummy; then \
+ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ || exit 1; \
+ fi; \
+ done
+ @if test -n "$(TEST_PROGS_PARA)$(TEST_SCRIPTS_PARA)"; then \
+ echo "===Parallel tests in `echo ${PWD} | sed -e s:.*/::` ended `date`===";\
+ fi
## Make installation directories directories if they don't exist.
$(libdir):
@@ -208,10 +258,24 @@ uninstall:
fi; \
done
+# General rule for recursive cleaning targets. Like the rule above,
+# but doesn't require building BUILT_SOURCES.
+check-clean:
+ @$(MAKE) $(AM_MAKEFLAGS) build-$@ || exit 1;
+ @for d in X $(SUBDIRS); do \
+ if test $$d != X && test $$d != .; then \
+ (set -x; cd $$d && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \
+ fi; \
+ done
+
+# clean up files generated by tests so they can be re-run.
+build-check-clean:
+ $(RM) -rf $(CHECK_CLEANFILES)
+
## Removes temporary files without removing the final target files. That is,
## remove things like object files but not libraries or executables.
##
-mostlyclean:
+mostlyclean: build-check-clean
@if test -n "$(LIB_OBJ)"; then \
$(RM) $(LIB_OBJ) $(LIB_OBJ:.lo=.o); \
fi
diff --git a/hl/Makefile.in b/hl/Makefile.in
index 3748fe9..7760fd1 100755
--- a/hl/Makefile.in
+++ b/hl/Makefile.in
@@ -65,7 +65,7 @@ SUBDIRS=src test tools
## programs and C compilers. At the other extreme, the GNU
## make used in combination with gcc will maintain dependency
## information automatically.
-lib progs check check-s check-p test _test uninstall:
+lib progs check check-s check-p check-clean test _test uninstall:
@@SETX@; for d in $(SUBDIRS); do \
(cd $$d && $(MAKE) $@) || exit 1; \
done
diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in
index bc83d41..9577f35 100644
--- a/hl/tools/Makefile.in
+++ b/hl/tools/Makefile.in
@@ -69,7 +69,7 @@ dep depend:
fi; \
done
-check check-s check-p tests test _test: $(PROGS)
+check check-s check-p check-clean tests test _test: $(PROGS)
@@SETX@; for d in X $(SUBDIRS); do \
if test $$d != X; then \
(cd $$d && $(MAKE) $@) || exit 1; \
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 6b6d645..84e032c 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -62,7 +62,7 @@ dep depend:
fi; \
done
-check check-s check-p tests test _test: $(PROGS)
+check check-s check-p check-clean tests test _test: $(PROGS)
@@SETX@; for d in X lib $(SUBDIRS); do \
if test $$d != X; then \
(cd $$d && $(MAKE) $@) || exit 1; \