From: Stefano Lattarini Date: Tue, 9 Aug 2011 16:04:14 +0000 (+0200) Subject: Merge branch 'master' into test-protocols X-Git-Tag: ng-0.5a~89^2~112^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18fb6351e0d7ffe88aac6043e43bcc5163a1dd53;p=thirdparty%2Fautomake.git Merge branch 'master' into test-protocols * master: tests: don't let a known Solaris make bug poison too many tests gitignore: more use of anchors --- 18fb6351e0d7ffe88aac6043e43bcc5163a1dd53 diff --cc lib/Automake/tests/.gitignore index bc2e76df1,9da0540c8..56e8f3672 --- a/lib/Automake/tests/.gitignore +++ b/lib/Automake/tests/.gitignore @@@ -1,3 -1,2 +1,2 @@@ - *.log - *.log-t - *.trs ++/*.trs + /*.log -/*.log-t diff --cc tests/.gitignore index 0d5a032b5,cddf84b69..eac67e60e --- a/tests/.gitignore +++ b/tests/.gitignore @@@ -1,13 -1,12 +1,13 @@@ - aclocal-* - automake-* - defs-static - instspc-tests.am - parallel-tests.am - *.dir - *.log - *.trs - *.log-t - *-p.test - instspc-*-build.test - instspc-*-install.test - *.test-t + /aclocal-* + /automake-* + /defs-static + /instspc-tests.am + /parallel-tests.am + /*.dir + /*.log ++/*.trs + /*.log-t + /*-p.test + /instspc-*-build.test + /instspc-*-install.test + /*.test-t diff --cc tests/defs index b682c5e77,dba01fbf0..533c88120 --- a/tests/defs +++ b/tests/defs @@@ -203,43 -204,41 +203,78 @@@ using_gmake ( esac } + # make_can_chain_suffix_rules + # --------------------------- + # Return 0 if $MAKE is a make implementation that can chain suffix rules + # automatically, return 1 otherwise. Caches the result for speed reasons. + make_can_chain_suffix_rules () + { + if test -z "$am__can_chain_suffix_rules"; then + if using_gmake; then + am__can_chain_suffix_rules=yes + return 0 + else + mkdir am__chain.dir$$ + cd am__chain.dir$$ + unindent > Makefile << 'END' + .u.v: ; cp $< $@ + .v.w: ; cp $< $@ + END + echo make can chain suffix rules > foo.u + if $MAKE foo.w && diff foo.u foo.w; then + am__can_chain_suffix_rules=yes + else + am__can_chain_suffix_rules=no + fi + cd .. + rm -rf am__chain.dir$$ + fi + fi + case $am__can_chain_suffix_rules in + yes) return 0;; + no) return 1;; + *) fatal_ "make_can_chain_suffix_rules: internal error";; + esac + } + am__can_chain_suffix_rules="" # Avoid interferences from the environment. + +# count_test_results total=N pass=N fail=N xpass=N xfail=N skip=N error=N +# ----------------------------------------------------------------------- +# Check that a testsuite run driven by the parallel-tests harness has +# had the specified numbers of test results (specified by kind). +# This function assumes that the output of "make check" or "make recheck" +# has been saved in the `stdout' file in the current directory, and its +# log in the `test-suite.log' file. +count_test_results () +{ + # Use a subshell so that we won't pollute the script namespace. + ( + # TODO: Do proper checks on the arguments? + total=ERR pass=ERR fail=ERR xpass=ERR xfail=ERR skip=ERR error=ERR + eval "$@" + # For debugging. + $EGREP -i '(total|x?pass|x?fail|skip|error)' stdout || : + rc=0 + # Avoid spurious failures with shells with "overly sensible" + # `errexit' shell flag, such as e.g., Solaris /bin/sh. + set +e + test `grep -c '^PASS:' stdout` -eq $pass || rc=1 + test `grep -c '^XFAIL:' stdout` -eq $xfail || rc=1 + test `grep -c '^SKIP:' stdout` -eq $skip || rc=1 + test `grep -c '^FAIL:' stdout` -eq $fail || rc=1 + test `grep -c '^XPASS:' stdout` -eq $xpass || rc=1 + test `grep -c '^ERROR:' stdout` -eq $error || rc=1 + grep "^# TOTAL: *$total$" stdout || rc=1 + grep "^# PASS: *$pass$" stdout || rc=1 + grep "^# XFAIL: *$xfail$" stdout || rc=1 + grep "^# SKIP: *$skip$" stdout || rc=1 + grep "^# FAIL: *$fail$" stdout || rc=1 + grep "^# XPASS: *$xpass$" stdout || rc=1 + grep "^# ERROR: *$error$" stdout || rc=1 + test $rc -eq 0 + ) +} + commented_sed_unindent_prog=' /^$/b # Nothing to do for empty lines. x # Get x into pattern space.