From: Stefano Lattarini Date: Thu, 16 Jun 2011 08:41:49 +0000 (+0200) Subject: Merge branch 'tests-defs-fix-stderr-redirect-bug' into testsuite-work X-Git-Tag: ng-0.5a~89^2~185 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a65acce263dd789f004567857ff56d43d2975a35;p=thirdparty%2Fautomake.git Merge branch 'tests-defs-fix-stderr-redirect-bug' into testsuite-work --- a65acce263dd789f004567857ff56d43d2975a35 diff --cc ChangeLog index 2029e92cd,751410afb..cce35e5f0 --- a/ChangeLog +++ b/ChangeLog @@@ -1,71 -1,32 +1,100 @@@ + 2011-06-14 Stefano Lattarini + Jim Meyering + + test defs: fix ksh-related portability bug in warning messages + Running "make check" normally prints a diagnostic to the outermost + stderr (usually a tty) to explain why a test is skipped, thus + giving better and faster feedback to the user. It used to do + so by redirecting file descriptor 9 to stderr (via "exec 9>&2") + before invoking the test scripts, which then would write any skip + explanation to file descriptor 9 via the `skip_' function defined + in `tests/defs'. + However, various Korn Shells (at least Solaris 10's /bin/ksh and + Debian GNU/Linux's /bin/ksh) and the HP-UX's /bin/sh close open + file descriptors > 2 upon an `exec' system call; thus the effects + of "exec 9>&2" are cancelled upon fork-and-exec, so we would get + a "Bad file number" diagnostic and no skip explanation with those + shells. + The present change remedies this situation. + * tests/Makefile.am (AM_TESTS_ENVIRONMENT): Redirect more portably, + via a trailing "9>&2", rather than the prior "exec 9>&2; ...". Add + explanatory comments. + * tests/defs (stderr_fileno_): Update the advice in comments. + Based on commit v8.12-82-g6b68745 "tests: accommodate HP-UX and + ksh-derived shells" in GNU coreutils. + Further references, with lots of discussion: + + + + +2011-06-13 Stefano Lattarini + + tests: remove 'test_prefer_config_shell' from the environment + Since commit `v1.11-910-g7df1a9b', the once user-overridable + variable `$test_prefer_config_shell' has become an internal + detail, and the test scripts now complain and bail out if it is + set in the environment. + * tests/Makefile.am (AM_TESTS_ENVIRONMENT): Unset the variable + `test_prefer_config_shell' if it is set in the environment. + +2011-06-13 Stefano Lattarini + + tests: autogenerate list of wrapped tests for `lib/' shell scripts + * tests/gen-config-shell-tests: New script, generates distributed + makefile snippet `tests/config-shell-tests.am' to list all tests + that use the `get_shell_script' function, with names mangled to + use suffix `-w.shtst', in ... + * tests/Makefile.am (config_shell_tests): ... this macro, whose + definition has been consequently removed from Makefile.am. + (EXTRA_DIST): Distribute the new script. + ($(srcdir)/config-shell-tests.am): Generate using the new script. + (include): Include the `config-shell-tests.am' fragment. + * bootstrap: Invoke `tests/gen-config-shell-tests' to generate + `tests/config-shell-tests.am'. + * tests/.gitignore: Ignore `config-shell-tests.am'. + * tests/gen-parallel-tests: Fixlet in heading comments. + +2011-06-13 Stefano Lattarini + + tests: test mdate-sh with /bin/sh too + * tests/mdate5.test: Fetch the `mdate-sh' script using the + `get_shell_script' function, and run it directly instead of + using `$SHELL'. + * tests/mdate6.test: Likewise. Since we are at it, make checks + on the `mdate-sh' output stricter, remove now unneeded calls to + aclocal and automake and creation/extension of `configure.in', + `Makefile.am' and `textutils.tex' files, and add a trailing `:' + command. + * tests/Makefile.am (config_shell_tests): Add `mdate5-w.shtst' + and `mdate6-w.shtst'. + +2011-06-13 Stefano Lattarini + + tests: extend tests on `--add-missing' and `--copy' a bit + * tests/add-missing.test: Fix typo in heading comments. Try with + another testcase that install many (but not all) the auxiliary + scripts at once, and uses non-standard (but valid and documented) + setups (e.g., defining YACC in Makefile.am instead of calling + AC_PROG_YACC from configure.in). + * tests/copy.test: Reference `add-missing.test' in heading + comments. Try few more test scenarios. + +2011-06-16 Stefano Lattarini + + tests: few fixlets and improvements + * tests/cond31.test ($required): Remove `cc', it's not really + needed. + * tests/confh.test: Call autoheader too. The lack of this call + wasn't causing spurious failures because the automatic remake + rules were somehow invoking it on our behalf (at make time). + * tests/fn99subdir.test: Use $subdirname throughout, instead of + ${subdirname}, for consistency with the rest of the testsuite. + Avoid an unnecessary subshell, which could also cause spurious + passes, being guarded by a trailing `|| Exit 1', which neutralize + the `errexit' flag. Remove an unnecessary `|| Exit 1' guard. + * tests/insh2.test: Rewrite to avoid hackish Makefile.in munging, + and to also run configure and make. + 2011-06-13 Stefano Lattarini tests: don't hard-code test name in txinfo21.test diff --cc tests/Makefile.in index 0c1fc5457,57791f31a..54c917f7a --- a/tests/Makefile.in +++ b/tests/Makefile.in @@@ -387,17 -386,29 +387,15 @@@ depmod_tests = depcomp-gcc3.depmod depc depcomp-cpp.depmod depcomp-msvisualcpp.depmod \ depcomp-msvcmsys.depmod DEPMOD_LOG_COMPILER = $(SHELL) $(srcdir)/depmod-tests.sh +config_shell_tests = ar-lib-w.shtst compile-w.shtst compile2-w.shtst \ + compile3-w.shtst compile4-w.shtst compile5-w.shtst \ + compile6-w.shtst instsh2-w.shtst instsh3-w.shtst \ + mdate5-w.shtst mdate6-w.shtst missing-w.shtst missing2-w.shtst \ + missing3-w.shtst missing5-w.shtst mkinst3-w.shtst SHTST_LOG_COMPILER = $(SHELL) $(srcdir)/config-shell-tests.sh -# FIXME: this list might probably be made auto-generated, like -# $(parallel_tests) is... But would that worth the hassle? -config_shell_tests = \ - ar-lib-w.shtst \ - compile-w.shtst \ - compile2-w.shtst \ - compile3-w.shtst \ - compile4-w.shtst \ - compile5-w.shtst \ - compile6-w.shtst \ - instsh2-w.shtst \ - instsh3-w.shtst \ - mkinst3-w.shtst \ - missing-w.shtst \ - missing2-w.shtst \ - missing3-w.shtst \ - missing5-w.shtst - - # Some testsuite-influential variables should be overridable from the # test scripts, but not from the environment. - # We want warning messages and explanations for skipped tests to go to - # the console if possible, so set up `stderr_fileno_' properly. # The `AM_TESTS_REEXEC=no' setting tells the tests not to needlessly # re-execute themselves with the shell detected at configure time, since # we are already running them under it explicitly in our setup (see e.g.