* test/Makefile.am (AUTOMAKE_OPTIONS): Colorized tests was not

actually activated since it needed to be enabled in this
Makefile.am.  Also activated parallel-tests mode since it offers
useful features such as per-test .log files and a summary test
report .log file.
This commit is contained in:
Bob Friesenhahn 2009-08-21 16:52:14 +00:00
parent 8297307011
commit 38521145a6
5 changed files with 310 additions and 99 deletions

View File

@ -1,3 +1,11 @@
2009-08-21 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* test/Makefile.am (AUTOMAKE_OPTIONS): Colorized tests was not
actually activated since it needed to be enabled in this
Makefile.am. Also activated parallel-tests mode since it offers
useful features such as per-test .log files and a summary test
report .log file.
2009-08-20 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* configure.ac: Updated autotools. Autoconf 2.64, Automake 1.11,

View File

@ -25,7 +25,7 @@
docdir = $(LIBTIFF_DOCDIR)
AUTOMAKE_OPTIONS = 1.11 color-tests dist-zip foreign
AUTOMAKE_OPTIONS = 1.11 dist-zip foreign
ACLOCAL_AMFLAGS = -I m4
docfiles = \

View File

@ -311,7 +311,7 @@ target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = 1.11 color-tests dist-zip foreign
AUTOMAKE_OPTIONS = 1.11 dist-zip foreign
ACLOCAL_AMFLAGS = -I m4
docfiles = \
COPYRIGHT \

View File

@ -23,6 +23,8 @@
# Process this file with automake to produce Makefile.in.
AUTOMAKE_OPTIONS = 1.11 color-tests parallel-tests foreign
LIBTIFF = $(top_builddir)/libtiff/libtiff.la
EXTRA_DIST = \

View File

@ -129,8 +129,91 @@ DIST_SOURCES = $(ascii_tag_SOURCES) $(long_tag_SOURCES) \
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
# If stdout is a non-dumb tty, use colors. If test -t is not supported,
# then this fails; a conservative approach. Of course do not redirect
# stdout here, just stderr.
am__tty_colors = \
red=; grn=; lgn=; blu=; std=
red=; grn=; lgn=; blu=; std=; \
test "X$(AM_COLOR_TESTS)" != Xno \
&& test "X$$TERM" != Xdumb \
&& { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \
&& { \
red=''; \
grn=''; \
lgn=''; \
blu=''; \
std=''; \
}
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
# Restructured Text title and section.
am__rst_title = sed 's/.*/ & /;h;s/./=/g;p;x;p;g;p;s/.*//'
am__rst_section = sed 'p;s/./=/g;p;g'
# Put stdin (possibly several lines separated by ". ") in a box.
am__text_box = $(AWK) '{ \
n = split($$0, lines, "\\. "); max = 0; \
for (i = 1; i <= n; ++i) \
if (max < length(lines[i])) \
max = length(lines[i]); \
for (i = 0; i < max; ++i) line = line "="; \
print line; \
for (i = 1; i <= n; ++i) if (lines[i]) print lines[i];\
print line; \
}'
# Solaris 10 'make', and several other traditional 'make' implementations,
# pass "-e" to $(SHELL). This contradicts POSIX. Work around the problem
# by disabling -e (using the XSI extension "set +e") if it's set.
am__sh_e_setup = case $$- in *e*) set +e;; esac
# To be inserted before the command running the test. Creates the
# directory for the log if needed. Stores in $dir the directory
# containing $f, in $tst the test, in $log the log, and passes
# TESTS_ENVIRONMENT. Save and restore TERM around use of
# TESTS_ENVIRONMENT, in case that unsets it.
am__check_pre = \
$(am__sh_e_setup); \
$(am__vpath_adj_setup) $(am__vpath_adj) \
srcdir=$(srcdir); export srcdir; \
rm -f $@-t; \
trap 'st=$$?; rm -f '\''$(abs_builddir)/$@-t'\''; (exit $$st); exit $$st' \
1 2 13 15; \
am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`; \
test "x$$am__odir" = x. || $(MKDIR_P) "$$am__odir" || exit $$?; \
if test -f "./$$f"; then dir=./; \
elif test -f "$$f"; then dir=; \
else dir="$(srcdir)/"; fi; \
tst=$$dir$$f; log='$@'; __SAVED_TERM=$$TERM; \
$(TESTS_ENVIRONMENT)
RECHECK_LOGS = $(TEST_LOGS)
AM_RECURSIVE_TARGETS = check check-html recheck recheck-html
TEST_SUITE_LOG = test-suite.log
TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html)
TEST_EXTENSIONS = @EXEEXT@ .test
LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
am__test_logs1 = $(TESTS:=.log)
am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
TEST_LOGS = $(am__test_logs2:.test.log=.log)
TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
$(TEST_LOG_FLAGS)
TEST_LOGS_TMP = $(TEST_LOGS:.log=.log-t)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@ -280,6 +363,7 @@ target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = 1.11 color-tests parallel-tests foreign
LIBTIFF = $(top_builddir)/libtiff/libtiff.la
EXTRA_DIST = \
$(TESTSCRIPTS) \
@ -341,7 +425,7 @@ INCLUDES = -I$(top_srcdir)/libtiff
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
.SUFFIXES: .c .html .lo .log .o .obj .test .test$(EXEEXT)
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
@ -494,97 +578,209 @@ GTAGS:
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
check-TESTS: $(TESTS)
@failed=0; all=0; xfail=0; xpass=0; skip=0; \
srcdir=$(srcdir); export srcdir; \
list=' $(TESTS) '; \
# To be appended to the command running the test. Handle the stdout
# and stderr redirection, and catch the exit status.
am__check_post = \
>$@-t 2>&1; \
estatus=$$?; \
if test -n '$(DISABLE_HARD_ERRORS)' \
&& test $$estatus -eq 99; then \
estatus=1; \
fi; \
TERM=$$__SAVED_TERM; export TERM; \
$(am__tty_colors); \
if test -n "$$list"; then \
for tst in $$list; do \
if test -f ./$$tst; then dir=./; \
elif test -f $$tst; then dir=; \
else dir="$(srcdir)/"; fi; \
if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
all=`expr $$all + 1`; \
xfailed=PASS; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$tst[\ \ ]*) \
xpass=`expr $$xpass + 1`; \
failed=`expr $$failed + 1`; \
col=$$red; res=XPASS; \
;; \
*) \
col=$$grn; res=PASS; \
;; \
*[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
xfailed=XFAIL;; \
esac; \
elif test $$? -ne 77; then \
all=`expr $$all + 1`; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$tst[\ \ ]*) \
xfail=`expr $$xfail + 1`; \
col=$$lgn; res=XFAIL; \
;; \
*) \
failed=`expr $$failed + 1`; \
col=$$red; res=FAIL; \
;; \
case $$estatus:$$xfailed in \
0:XFAIL) col=$$red; res=XPASS;; \
0:*) col=$$grn; res=PASS ;; \
77:*) col=$$blu; res=SKIP ;; \
99:*) col=$$red; res=FAIL ;; \
*:XFAIL) col=$$lgn; res=XFAIL;; \
*:*) col=$$red; res=FAIL ;; \
esac; \
echo "$${col}$$res$${std}: $$f"; \
echo "$$res: $$f (exit: $$estatus)" | \
$(am__rst_section) >$@; \
cat $@-t >>$@; \
rm -f $@-t
$(TEST_SUITE_LOG): $(TEST_LOGS)
@$(am__sh_e_setup); \
list='$(TEST_LOGS)'; \
results=`for f in $$list; do \
read line < $$f && echo "$$line" || echo FAIL; \
done`; \
all=`echo "$$results" | sed '/^$$/d' | wc -l | sed -e 's/^[ ]*//'`; \
fail=`echo "$$results" | grep -c '^FAIL'`; \
pass=`echo "$$results" | grep -c '^PASS'`; \
skip=`echo "$$results" | grep -c '^SKIP'`; \
xfail=`echo "$$results" | grep -c '^XFAIL'`; \
xpass=`echo "$$results" | grep -c '^XPASS'`; \
failures=`expr $$fail + $$xpass`; \
all=`expr $$all - $$skip`; \
if test "$$all" -eq 1; then tests=test; All=; \
else tests=tests; All="All "; fi; \
case fail=$$fail:xpass=$$xpass:xfail=$$xfail in \
fail=0:xpass=0:xfail=0) \
msg="$$All$$all $$tests passed. "; \
exit=true;; \
fail=0:xpass=0:xfail=*) \
msg="$$All$$all $$tests behaved as expected"; \
if test "$$xfail" -eq 1; then xfailures=failure; \
else xfailures=failures; fi; \
msg="$$msg ($$xfail expected $$xfailures). "; \
exit=true;; \
fail=*:xpass=0:xfail=*) \
msg="$$fail of $$all $$tests failed. "; \
exit=false;; \
fail=*:xpass=*:xfail=*) \
msg="$$failures of $$all $$tests did not behave as expected"; \
if test "$$xpass" -eq 1; then xpasses=pass; \
else xpasses=passes; fi; \
msg="$$msg ($$xpass unexpected $$xpasses). "; \
exit=false;; \
*) \
echo >&2 "incorrect case"; exit 4;; \
esac; \
else \
skip=`expr $$skip + 1`; \
col=$$blu; res=SKIP; \
fi; \
echo "$${col}$$res$${std}: $$tst"; \
done; \
if test "$$all" -eq 1; then \
tests="test"; \
All=""; \
else \
tests="tests"; \
All="All "; \
fi; \
if test "$$failed" -eq 0; then \
if test "$$xfail" -eq 0; then \
banner="$$All$$all $$tests passed"; \
else \
if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
fi; \
else \
if test "$$xpass" -eq 0; then \
banner="$$failed of $$all $$tests failed"; \
else \
if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
fi; \
fi; \
dashes="$$banner"; \
skipped=""; \
if test "$$skip" -ne 0; then \
if test "$$skip" -eq 1; then \
skipped="($$skip test was not run)"; \
msg="$$msg($$skip test was not run). "; \
else \
skipped="($$skip tests were not run)"; \
msg="$$msg($$skip tests were not run). "; \
fi; \
test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$skipped"; \
fi; \
report=""; \
if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
report="Please report to $(PACKAGE_BUGREPORT)"; \
test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
dashes="$$report"; \
{ \
echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
$(am__rst_title); \
echo "$$msg"; \
echo; \
echo ".. contents:: :depth: 2"; \
echo; \
for f in $$list; do \
read line < $$f; \
case $$line in \
PASS:*|XFAIL:*);; \
*) echo; cat $$f;; \
esac; \
done; \
} >$(TEST_SUITE_LOG).tmp; \
mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
if test "$$failures" -ne 0; then \
msg="$${msg}See $(subdir)/$(TEST_SUITE_LOG). "; \
if test -n "$(PACKAGE_BUGREPORT)"; then \
msg="$${msg}Please report to $(PACKAGE_BUGREPORT). "; \
fi; \
dashes=`echo "$$dashes" | sed s/./=/g`; \
if test "$$failed" -eq 0; then \
echo "$$grn$$dashes"; \
fi; \
test x"$$VERBOSE" = x || $$exit || cat $(TEST_SUITE_LOG); \
$(am__tty_colors); \
if $$exit; then \
echo $(ECHO_N) "$$grn$(ECHO_C)"; \
else \
echo "$$red$$dashes"; \
echo $(ECHO_N) "$$red$(ECHO_C)"; \
fi; \
echo "$$banner"; \
test -z "$$skipped" || echo "$$skipped"; \
test -z "$$report" || echo "$$report"; \
echo "$$dashes$$std"; \
test "$$failed" -eq 0; \
else :; fi
echo "$$msg" | $(am__text_box); \
echo $(ECHO_N) "$$std$(ECHO_C)"; \
$$exit
# Run all the tests.
check-TESTS:
@list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@set_logs=; if test "X$(TEST_LOGS)" = X.log; then \
set_logs=TEST_LOGS=; \
fi; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) $$set_logs
.log.html:
@list='$(RST2HTML) $$RST2HTML rst2html rst2html.py'; \
for r2h in $$list; do \
if ($$r2h --version) >/dev/null 2>&1; then \
R2H=$$r2h; \
fi; \
done; \
if test -z "$$R2H"; then \
echo >&2 "cannot find rst2html, cannot create $@"; \
exit 2; \
fi; \
$$R2H $< >$@.tmp
@mv $@.tmp $@
# Be sure to run check first, and then to convert the result.
# Beware of concurrent executions. Run "check" not "check-TESTS", as
# check-SCRIPTS and other dependencies are rebuilt by the former only.
# And expect check to fail.
check-html:
@if $(MAKE) $(AM_MAKEFLAGS) check; then \
rv=0; else rv=$$?; \
fi; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_HTML) || exit 4; \
exit $$rv
recheck recheck-html:
@target=`echo $@ | sed 's,^re,,'`; \
list='$(TEST_LOGS)'; \
list=`for f in $$list; do \
test -f $$f || continue; \
if read line < $$f; then \
case $$line in FAIL*|XPASS*) echo $$f;; esac; \
else echo $$f; fi; \
done | tr '\012\015' ' '`; \
$(MAKE) $(AM_MAKEFLAGS) $$target AM_MAKEFLAGS='$(AM_MAKEFLAGS) TEST_LOGS="'"$$list"'"'
ascii_tag.log: ascii_tag$(EXEEXT)
@p='ascii_tag$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
long_tag.log: long_tag$(EXEEXT)
@p='long_tag$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
short_tag.log: short_tag$(EXEEXT)
@p='short_tag$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
strip_rw.log: strip_rw$(EXEEXT)
@p='strip_rw$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
rewrite.log: rewrite$(EXEEXT)
@p='rewrite$(EXEEXT)'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiffcp-g3.sh.log: tiffcp-g3.sh
@p='tiffcp-g3.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiffcp-g3-1d.sh.log: tiffcp-g3-1d.sh
@p='tiffcp-g3-1d.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiffcp-g3-1d-fill.sh.log: tiffcp-g3-1d-fill.sh
@p='tiffcp-g3-1d-fill.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiffcp-g3-2d.sh.log: tiffcp-g3-2d.sh
@p='tiffcp-g3-2d.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiffcp-g3-2d-fill.sh.log: tiffcp-g3-2d-fill.sh
@p='tiffcp-g3-2d-fill.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiffcp-g4.sh.log: tiffcp-g4.sh
@p='tiffcp-g4.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiffcp-logluv.sh.log: tiffcp-logluv.sh
@p='tiffcp-logluv.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiffcp-thumbnail.sh.log: tiffcp-thumbnail.sh
@p='tiffcp-thumbnail.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiffdump.sh.log: tiffdump.sh
@p='tiffdump.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiffinfo.sh.log: tiffinfo.sh
@p='tiffinfo.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiffcp-split.sh.log: tiffcp-split.sh
@p='tiffcp-split.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiffcp-split-join.sh.log: tiffcp-split-join.sh
@p='tiffcp-split-join.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiff2ps-PS1.sh.log: tiff2ps-PS1.sh
@p='tiff2ps-PS1.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiff2ps-PS2.sh.log: tiff2ps-PS2.sh
@p='tiff2ps-PS2.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiff2ps-PS3.sh.log: tiff2ps-PS3.sh
@p='tiff2ps-PS3.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiff2ps-EPS1.sh.log: tiff2ps-EPS1.sh
@p='tiff2ps-EPS1.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiff2pdf.sh.log: tiff2pdf.sh
@p='tiff2pdf.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiffcrop.sh.log: tiffcrop.sh
@p='tiffcrop.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
tiff2rgba.sh.log: tiff2rgba.sh
@p='tiff2rgba.sh'; $(am__check_pre) $(LOG_COMPILE) "$$tst" $(am__check_post)
.test.log:
@p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post)
@am__EXEEXT_TRUE@.test$(EXEEXT).log:
@am__EXEEXT_TRUE@ @p='$<'; $(am__check_pre) $(TEST_LOG_COMPILE) "$$tst" $(am__check_post)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@ -637,6 +833,10 @@ install-strip:
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
-test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
-test -z "$(TEST_LOGS_TMP)" || rm -f $(TEST_LOGS_TMP)
-test -z "$(TEST_SUITE_HTML)" || rm -f $(TEST_SUITE_HTML)
-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
@ -719,10 +919,11 @@ ps-am:
uninstall-am:
.MAKE: check-am install-am install-strip
.MAKE: check-am check-html install-am install-strip recheck \
recheck-html
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
clean-checkPROGRAMS clean-generic clean-libtool ctags \
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am check-html \
clean clean-checkPROGRAMS clean-generic clean-libtool ctags \
distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
@ -733,7 +934,7 @@ uninstall-am:
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am
recheck recheck-html tags uninstall uninstall-am
# Tell versions [3.59,3.63) of GNU make to not export all variables.