+2011-08-07 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ testsuite: TAP tests can have early plan now
+ * tests/defs: When using TAP, allow the user to specify the number
+ of tests through the `$planned' variable.
+ (trap): Do not print the auto-generated plan if an explicit one
+ has already been printed.
+ * tests/defs-static.in: Complain and bail out if the `$planned'
+ variable is exported in the environment. Reformat the code to
+ facilitate future additions.
+ * tests/Makefile.am (TESTS_ENVIRONMENT): Neutralize `$planned'.
+ * tests/self-check-env-sanitize.test: Update.
+ * tests/ac-output-old.tap: Give an explicit TAP plan, by defining
+ `$planned' just before including `./defs'.
+ * tests/depmode.tap: Likewise.
+ * tests/automake-cmdline.tap: Likewise.
+ * tests/tap-bad-prog.tap: Likewise.
+ * tests/instspc.tap: Likewise, and related adjustments.
+ * tests/add-missing.tap: Make it explicit that we have no a-priori
+ plan, and tell why.
+
2011-08-07 Stefano Lattarini <stefano.lattarini@gmail.com>
testsuite: run autogenerated tests with $(LOG_COMPILER) too
AM_TESTS_ENVIRONMENT = \
test x"$$me" = x || unset me; \
test x"$$required" = x || unset required; \
+ test x"$$planned" = x || unset planned; \
test x"$$use_tap" = x || unset use_tap; \
test x"$$parallel_tests" = x || unset parallel_tests; \
test x"$$test_prefer_config_shell" || unset test_prefer_config_shell; \
# we are already running them under it explicitly in our setup (see e.g.
# the definition of TEST_LOG_COMPILER above).
AM_TESTS_ENVIRONMENT = test x"$$me" = x || unset me; test \
- x"$$required" = x || unset required; test x"$$use_tap" = x || \
- unset use_tap; test x"$$parallel_tests" = x || unset \
- parallel_tests; test x"$$test_prefer_config_shell" || unset \
+ x"$$required" = x || unset required; test x"$$planned" = x || \
+ unset planned; test x"$$use_tap" = x || unset use_tap; test \
+ x"$$parallel_tests" = x || unset parallel_tests; test \
+ x"$$test_prefer_config_shell" || unset \
test_prefer_config_shell; test x"$$original_AUTOMAKE" = x || \
unset original_AUTOMAKE; test x"$$original_ACLOCAL" = x || \
unset original_ACLOCAL; AM_TESTS_REEXEC=no; export \
# line breaking in the use of AC_OUTPUT. Synthesised by a bunch
# of older tests (referenced below).
+planned=22
. ./defs || Exit 1
rm -f configure.in depcomp # Not required.
# the files) it's supposed to, and that these files are symlinked by
# default, but copied if the `--copy' option is used.
+planned=unknown # Counting it would be too much data-dependent.
. ./defs || Exit 1
build_aux=build-aux
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Test Automake's command-line options.
+
+planned=17
. ./defs || Exit 1
# Usage: bad_cmdline DESCRIPTION REGEX-FOR-STDERR [ARGS-FOR-AUTOMAKE...]
## required by them. ##
## ----------------------------------------------------------- ##
+# The TAP plan must be either the fist or last line of output.
+if test $using_tap = yes && test ${planned-unknown} != unknown; then
+ plan_ "$planned"
+fi
+
# Print it here, so that the user will see it also if the test
# will be skipped due to some tool missing in $PATH itself.
echo "$PATH"
set +x
test "$signal" != 0 && echo "$me: caught signal $signal"
echo "$me: exit $exit_status"
- test $using_tap = yes && late_plan_
+ if test $using_tap = yes && test $have_tap_plan_ != yes; then
+ late_plan_
+ fi
exit $exit_status
' 0
for signal in 1 2 13 15; do
# Check that the environment is properly sanitized.
# Having variables exported to the empty string is OK, since our code
# treats such variables as if they were unset.
-for var in me required use_tap parallel_tests test_prefer_config_shell \
- original_AUTOMAKE original_ACLOCAL;
-do
+for var in \
+ me \
+ required \
+ planned \
+ use_tap \
+ parallel_tests \
+ test_prefer_config_shell \
+ original_AUTOMAKE \
+ original_ACLOCAL \
+; do
if eval "test x\"\$$var\" != x" && env | grep "^$var=" >/dev/null; then
echo "$argv0: variable \`$var' is set in the environment:" \
"this is unsafe" >&2
# which caused make to die with an error like:
# "sub/.deps/subfoo.Po:3: *** missing separator. Stop."
+# Per each valid depmode three kinds of VPATH, and per each of them
+# a test on "./configure" and one on "make & remake"; so there are
+# 17 * 3 * 2 = 102.
+planned=102
required=cc
. ./defs || Exit 99
# Original report from James Amundson about file names with spaces.
# Other characters added by Paul Eggert.
+planned=94 # Two tests per "problematic string".
. ./defs || Exit 99
# Usage: is_in_list ITEM [LIST...]
# characters in file names.
mkdir "./$test_string" || \
- skip_row_ 2 -r "mkdir failed" "$test_name"
+ skip_ -r "mkdir failed" "$test_name"
# Where are the "weird" characters going to be used, in $(builddir)
# or in $(DESTDIR)? They are always going to be used in $(prefix)
me
parallel_tests
required
+ planned
use_tap
test_prefer_config_shell
original_AUTOMAKE
# - missing, unreadable, or not-executable test scripts cause proper
# error reports
+planned=5
parallel_tests=yes
. ./defs || Exit 1