From: Stefano Lattarini Date: Tue, 9 Aug 2011 16:13:15 +0000 (+0200) Subject: Merge branch 'test-protocols' into tap-testsuite-work X-Git-Tag: ng-0.5a~89^2~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a758e7d0619627aba4f772925154c02e7042f28;p=thirdparty%2Fautomake.git Merge branch 'test-protocols' into tap-testsuite-work * test-protocols: tests: don't let a known Solaris make bug poison too many tests gitignore: more use of anchors --- 1a758e7d0619627aba4f772925154c02e7042f28 diff --cc ChangeLog index 350683850,9585ff4db..b9b621dd9 --- a/ChangeLog +++ b/ChangeLog @@@ -1,150 -1,39 +1,177 @@@ + 2011-08-09 Stefano Lattarini + + tests: don't let a known Solaris make bug poison too many tests + See automake bug#7670 and bug#7824. + * tests/defs (make_can_chain_suffix_rules): New function, tell + whether the make implementation in use can chain suffix rules + automatically or not. + * tests/suffix3.test: Use it to avoid issuing calls to make that + are unportable to make implementations that are not smart enough + to chain suffix rules automatically. + * tests/suffix8.test: Use it to avoid issuing calls to make that + * tests/suffix10.test: Use it to avoid issuing calls to make that + * tests/suffix11.test: Use it to avoid issuing calls to make that + * tests/suffix-chain.test: New test, exposes the limitation that + we have papered over in the tests above. + + 2011-08-09 Stefano Lattarini + + gitignore: more use of anchors + * .gitignore: Anchor files that are intended to be ignored only + if found in the same directory of the `.gitignore' file, not also + in its subdirectories. + * doc/.gitignore, doc/amhello/.gitignore, lib/Automake/.gitignore, + lib/Automake/tests/.gitignore, tests/.gitignore: Likewise. Also, + where needed, add new entries that were once implied by the + non-anchored entries in the upper-level `.gitignore' files. + 2011-08-09 Stefano Lattarini - testsuite: avoid spurious failure of self checks on Solaris - This is just a quick workaround to prevent having too much noise - in the testsuite; more proper fixes have been committed into the - 'testsuite-work' branch. - * tests/self-check-dir.test: Relax a test to avoid unimportant - failure on Solaris 10. - * tests/self-check-exit.test: Likewise. + self tests: avoid spurious output on console, and related fixlets + * tests/self-check-cleanup.test: Set `$stderr_fileno_' to `2' + in the self tests, to avoid spurious diagnostic on console. + * tests/self-check-exit.tap: Only unset `am_explicit_skips' and + `$stderr_fileno_' in the self tests, not at the global level, it + is more correct. + ($init): New variable, to reduce code duplication. + Some refactoring and adjustments to the name of the tests. + +2011-08-09 Stefano Lattarini + + test defs: few more sanity checks + * tests/defs: Catch some more (very unlikely) set-up or internal + errors, and diagnose them explicitly. This is intended mostly + to be a theoretic-only improvement. + +2011-08-09 Stefano Lattarini + + test defs: really make them "set -e" clean + Motivated by a spurious failure of test `instsh3-w.shtst' on + Solaris 10. + * tests/defs: Make really "set -e" clean, to avoid spurious + failures in case this file is sourced by a test script that has + already set the `errexit' flag. To be sure we don't regress, + move the `set -e' call much earlier, and make the comment telling + about the expected "set -e" cleanliness more loud and outstanding. + +2011-08-09 Stefano Lattarini + + self tests: register an expected failures with Solaris /bin/sh + Solaris 10 /bin/sh erroneously exit with success right away when + the following three conditions are met at the same time: + 1. the `errexit' flag is active, + 2. an exit trap is installed, and + 3. a non-existing command is issued. + * tests/self-exit.tap: When that bug is detected, issue an XFAIL + rather than a FAIL. Since we are at it, improve by avoiding + creation of stray temporary files when testing for non-executable + commands. + +2011-08-09 Stefano Lattarini + + gitignore: update and improve for the testsuite files + * tests/.gitignore: Don't ignore temporary partial log files, + autogenerated tests and makefile fragments that are not used + anymore. Anchor all the remaining patterns. + +2011-08-09 Stefano Lattarini + + self tests: some new uses of TAP, few extensions + * tests/self-check-me.test: Renamed ... + * tests/self-check-me.tap: .. to this, and converted to use TAP. + * tests/self-check-exit.test: Renamed ... + * tests/self-check-exit.tap: .. to this, and converted to use TAP. + Set `$stderr_fileno_' to `2', to avoid spurious messages on the + console. Add a new test, and relax another one. + * tests/self-check-env-sanitize.test: Renamed ... + * tests/self-check-env-sanitize.tap: .. to this, and converted to + the use TAP. + * tests/Makefile.am (TESTS): Update. + +2011-08-09 Stefano Lattarini + + test defs: test directory creation more configurable + After this change, the individual tests will be able to tell + `./defs' whether or not to create a temporary test directory + for them, and if yes, whether or not to pre-populate it. + * tests/defs: Only create the temporary test directory if the + variable `$am_create_testdir' is not set to "no". In this + case, only pre-populate it if that variable is not set to + `$empty'. + * tests/defs-static.in: Check that `$am_create_testdir' is not + exported in the environment. + * tests/self-check-env-sanitize.test: Update. + * tests/self-check-dir.test: Extend, and make deeper and more + robust. + * tests/README (Section "Writing test cases" subsection "Do"): + Update. + * tests/autodist.test: Set `$am_create_testdir' instead of + removing by hand files created by ./defs. + * tests/tap-doc2.test: Likewise. + +2011-08-08 Stefano Lattarini + + testsuite: more uses of the `seq_' function + * tests/parallel-tests-exit-statuses.test: Use the `seq_' function + from `tests/defs', instead of duplicating its semantics. + * tests/testsuite-summary-count.test: Likewise. + +2011-08-08 Stefano Lattarini + + testsuite: drop redundant environment sanitization + * tests/Makefile.am (TESTS_ENVIRONMENT): Don't remove `planned' + from the environment. + * tests/defs-static.in: Don't complain if `planned' is set in + the environment. + * tests/self-check-env-sanitize.test: Update. + +2011-08-08 Stefano Lattarini + + test defs: fix bug in plain version of `skip_all_' + * tests/plain-functions.sh (skip_all_): Call `skip_', not `skip'. + +2011-08-08 Stefano Lattarini + + test defs: small cleanups and tweakings + * tests/defs: Where possible, prefer `framework_failure_' or + `fatal_' to `Exit 99'. Try to catch more possible hard errors + and setup failures. Do not hide expected error messages. Avoid + a couple of forks when copying files from `$(top_srcdir)/lib'. + ($signal): Remove, no more needed. + +2011-08-08 Stefano Lattarini + + testsuite: improve interface for giving early TAP plan + Since commit `v1.11-976-g4740f56', an early TAP plan can also be + specified after input lines have already been seen, as long as + no one of them is a TAP result line. We can now take advantage + of this in our own testsuite, allowing the TAP-based scripts to + specify their earlier plan after having included `./defs'. In + particular, this offers the benefit of allowing those scripts to + issue a "skip all" plan (e.g., "1..0 # SKIP reason ...") after + the inclusion of `./defs', which wasn't possible with the older + interface (introduced in commit `v1.11-1114-g0286308'). + * tests/defs: Don't try to call `plan_' if `$planned' is defined, + the calling scripts can do that directly now. + * tests/ac-output-old.tap: Use `plan_' directly instead of + setting `$planned' before including `./defs'. + * tests/automake-cmdline.tap: Likewise. + * tests/depmod.tap: Likewise. + * tests/instspc.tap: Likewise. + * tests/tap-bad-prog.tap: Likewise. + * tests/add-missing.tap: Don't set `$planned'. + +2011-08-08 Stefano Lattarini + + test defs: fix bug in TAP version of `skip_all_' + * tests/tap-functions (skip_all_): Set `$have_tap_plan_' to "yes" + when called, so that the exit trap won't write another TAP plan. + +2011-08-08 Stefano Lattarini + + test defs: fix skip directives to work also with TAP-based tests + * test/defs: Use `skip_all_', not `skip_', to issue a skip of the + whole calling test script. 2011-08-08 Stefano Lattarini diff --cc tests/defs index 5e4c2c22e,533c88120..affb1c1cb --- a/tests/defs +++ b/tests/defs @@@ -295,61 -198,46 +295,95 @@@ using_gmake ( return 1 fi;; *) - echo "invalid value for \$am__using_gmake: '$am__using_gmake'" >&2 - Exit 99;; + fatal_ "invalid value for \$am__using_gmake: '$am__using_gmake'";; esac } +am__using_gmake="" # Avoid interferences from the environment. + # 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. + +# seq_ - print a sequence of numbers +# ---------------------------------- +# This function simulates GNU seq(1) portably. Valid usages: +# - seq LAST +# - seq FIRST LAST +# - seq FIRST INCREMENT LAST +seq_ () +{ + case $# in + 0) fatal_ "seq_: missing argument";; + 1) seq_first=1 seq_incr=1 seq_last=$1;; + 2) seq_first=$1 seq_incr=1 seq_last=$2;; + 3) seq_first=$1 seq_incr=$2 seq_last=$3;; + *) fatal_ "seq_: too many arguments";; + esac + # Try to avoid forks if possible. + case "$BASH_VERSION" in + ""|[12].*) + : Not bash, or a too old bash version. ;; + *) + # Use eval to protect dumber shells from parsing errors. + eval 'for ((i = seq_first; i <= seq_last; i += seq_incr)); do + echo $i + done' + return 0;; + esac + # Else, use GNU seq if available. + seq "$@" && return 0 + # Otherwise revert to a slower loop using expr(1). + i=$seq_first + while test $i -le $seq_last; do + echo $i + i=`expr $i + $seq_incr` + done +} + +# rm_rf_ [FILES OR DIRECTORIES ...] +# --------------------------------- +# Recursively remove the given files or directory, also handling the case +# of non-writable subdirectories. +rm_rf_ () +{ + test $# -gt 0 || return 0 + # Ignore failures in find, we are only interested in failures of the + # final rm. + find "$@" -type d ! -perm -700 -exec chmod u+rwx {} \; || : + rm -rf "$@" +} + - # 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