]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
testsuite: various fixlets and tweakings
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 19 Aug 2011 11:07:29 +0000 (13:07 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 19 Aug 2011 11:53:33 +0000 (13:53 +0200)
* tests/seenc.test: Make grepping of automake stderr stricter.
Add a trailing `:' command.
* tests/symlink.test: Likewise.  Also, define `$am_create_testdir'
to "empty" to avoid bringing in unused auxiliary files (only to
have to remove them right away), and use proper m4 quoting in
`configure.in'.
* tests/vpath.test: Make grepping of generated `Makefile.in'
slightly stricter.  Prefer trailing `:' over trailing `Exit 0'.
* tests/suffix6c.test: Unset OBJEXT to avoid interferences from
the environment.
* tests/suffix12.test: Do not whitespace-indent `##' comments
when they are embedded in a makefile rule: having them indented
is not part of the Automake API, and might cause failures with
e.g., Tru64 make.
* tests/syntax.test: Simplify the `Makefile.am' to ensure that
automake doesn't fail for the wrong reasons.  Make grepping of
automake stderr slightly stricter.
* tests/test-harness-vpath-rewrite.test: Remove useless variable
definition from `Makefile.am'.
* tests/test-driver-custom-multitest.test: Fix typo in comments.
* tests/self-check-me.tap: Fix minor typo in test description.
* tests/vars3.test: Make grepping of automake stderr stricter
and safer.
* tests/version6.test: Add sanity check, verifying that the
version number extracted from `automake --version' output seems
legit.
* tests/auxdir2.test: Renamed ...
* tests/auxdir-compauted.tap: ... to this, and converted to the
use of TAP.
* tests/auxdir4.test: Renamed ...
* tests/auxdir-unportable.tap: ... to this, and converted to the
use of TAP.
* tests/auxdir3.test: Renamed ...
* tests/auxdir-misplaced.test: ... to this.
* tests/auxdir5.test: Renamed ...
* tests/auxdir-nonexistent.test: ... to this.
* tests/auxdir9.test: Renamed ...
* tests/auxdir-autodetect.test: ... to this.
* tests/Makefile.am (TESTS): Update.
(XFAIL_TESTS): Remove `auxdir2.test'.

19 files changed:
ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/auxdir-autodetect.test [moved from tests/auxdir9.test with 100% similarity]
tests/auxdir-computed.tap [moved from tests/auxdir2.test with 86% similarity]
tests/auxdir-misplaced.test [moved from tests/auxdir3.test with 100% similarity]
tests/auxdir-nonexistent.test [moved from tests/auxdir5.test with 100% similarity]
tests/auxdir-unportable.tap [moved from tests/auxdir4.test with 73% similarity]
tests/seenc.test
tests/self-check-me.tap
tests/suffix12.test
tests/suffix6c.test
tests/symlink.test
tests/syntax.test
tests/test-driver-custom-multitest.test
tests/test-harness-vpath-rewrite.test
tests/vars3.test
tests/version6.test
tests/vpath.test

index e1d86f0bf17a5f18026d8f9437b7f9f97539e701..fb6bc35da871d802f446dc262d5dc1d9487e9797 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,47 @@
+2011-08-19  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       testsuite: various fixlets and tweakings
+       * tests/seenc.test: Make grepping of automake stderr stricter.
+       Add a trailing `:' command.
+       * tests/symlink.test: Likewise.  Also, define `$am_create_testdir'
+       to "empty" to avoid bringing in unused auxiliary files (only to
+       have to remove them right away), and use proper m4 quoting in
+       `configure.in'.
+       * tests/vpath.test: Make grepping of generated `Makefile.in'
+       slightly stricter.  Prefer trailing `:' over trailing `Exit 0'.
+       * tests/suffix6c.test: Unset OBJEXT to avoid interferences from
+       the environment.
+       * tests/suffix12.test: Do not whitespace-indent `##' comments
+       when they are embedded in a makefile rule: having them indented
+       is not part of the Automake API, and might cause failures with
+       e.g., Tru64 make.
+       * tests/syntax.test: Simplify the `Makefile.am' to ensure that
+       automake doesn't fail for the wrong reasons.  Make grepping of
+       automake stderr slightly stricter.
+       * tests/test-harness-vpath-rewrite.test: Remove useless variable
+       definition from `Makefile.am'.
+       * tests/test-driver-custom-multitest.test: Fix typo in comments.
+       * tests/self-check-me.tap: Fix minor typo in test description.
+       * tests/vars3.test: Make grepping of automake stderr stricter
+       and safer.
+       * tests/version6.test: Add sanity check, verifying that the
+       version number extracted from `automake --version' output seems
+       legit.
+       * tests/auxdir2.test: Renamed ...
+       * tests/auxdir-compauted.tap: ... to this, and converted to the
+       use of TAP.
+       * tests/auxdir4.test: Renamed ...
+       * tests/auxdir-unportable.tap: ... to this, and converted to the
+       use of TAP.
+       * tests/auxdir3.test: Renamed ...
+       * tests/auxdir-misplaced.test: ... to this.
+       * tests/auxdir5.test: Renamed ...
+       * tests/auxdir-nonexistent.test: ... to this.
+       * tests/auxdir9.test: Renamed ...
+       * tests/auxdir-autodetect.test: ... to this.
+       * tests/Makefile.am (TESTS): Update.
+       (XFAIL_TESTS): Remove `auxdir2.test'.
+
 2011-08-19  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        testsuite: fix some redundant autotools calls in tests on TAP
index b03d6a64973c4063fd6bd4e3b3febd51175916f4..337f8c684d35e94143fe098aefeaf860f03ec39e 100644 (file)
@@ -40,7 +40,6 @@ EXTRA_DIST = ChangeLog-old
 
 XFAIL_TESTS = \
 all.test \
-auxdir2.test \
 cond17.test \
 gcj6.test \
 override-conditional-2.test \
@@ -192,14 +191,14 @@ autohdr4.test \
 autohdrdry.test \
 automake-cmdline.tap \
 auxdir.test \
-auxdir2.test \
-auxdir3.test \
-auxdir4.test \
-auxdir5.test \
 auxdir6.test \
 auxdir7.test \
 auxdir8.test \
-auxdir9.test \
+auxdir-autodetect.test \
+auxdir-computed.tap \
+auxdir-misplaced.test \
+auxdir-nonexistent.test \
+auxdir-unportable.tap \
 backcompat.test \
 backcompat2.test \
 backcompat3.test \
index 1dfcffd7d357a7f2ebe156ed6826e4fdf74ce372..beada3f782dfa3496b98df3b83c88bce9dea3c4e 100644 (file)
@@ -309,7 +309,6 @@ EXTRA_DIST = ChangeLog-old gen-parallel-tests parallel-tests.sh \
        extract-testsuite-summary tap-setup.sh tap-summary-aux.sh
 XFAIL_TESTS = \
 all.test \
-auxdir2.test \
 cond17.test \
 gcj6.test \
 override-conditional-2.test \
@@ -435,14 +434,14 @@ autohdr4.test \
 autohdrdry.test \
 automake-cmdline.tap \
 auxdir.test \
-auxdir2.test \
-auxdir3.test \
-auxdir4.test \
-auxdir5.test \
 auxdir6.test \
 auxdir7.test \
 auxdir8.test \
-auxdir9.test \
+auxdir-autodetect.test \
+auxdir-computed.tap \
+auxdir-misplaced.test \
+auxdir-nonexistent.test \
+auxdir-unportable.tap \
 backcompat.test \
 backcompat2.test \
 backcompat3.test \
similarity index 86%
rename from tests/auxdir2.test
rename to tests/auxdir-computed.tap
index c915a6ba99581bdc5fee5e5fa3f531848a86643c..007eebc46bcf107ab7b5c3e8bedfa3706e7a0bdb 100755 (executable)
@@ -19,6 +19,8 @@
 
 . ./defs || Exit 1
 
+plan_ 3
+
 cat > configure.in <<END
 AC_INIT([$me], [1.0])
 AC_CONFIG_AUX_DIR([\$foo])
@@ -28,10 +30,10 @@ END
 
 : > Makefile.am
 
-$ACLOCAL
+command_ok_ "aclocal" $ACLOCAL
 # Both these two invocations are meant.
 # They exercise both code paths concerning auxiliary files.
-$AUTOMAKE -a
-$AUTOMAKE
+command_ok_ "automake -a" -D TODO -r "long-standing limitation" $AUTOMAKE -a
+command_ok_ "automake"    -D TODO -r "long-standing limitation" $AUTOMAKE
 
 :
similarity index 73%
rename from tests/auxdir4.test
rename to tests/auxdir-unportable.tap
index 09bde4a8dd8dbe5093bcadd2b5fe6cf87b19abb7..2eba8be6a60304561a07195f613c7debe5c44561 100755 (executable)
@@ -18,6 +18,8 @@
 
 . ./defs || Exit 1
 
+plan_ 4
+
 cat >configure.in <<END
 AC_INIT([$me], [1.0])
 AC_CONFIG_AUX_DIR([aux])
@@ -27,13 +29,23 @@ END
 
 : > Makefile.am
 
-$ACLOCAL
-AUTOMAKE_fails
-grep '^configure\.in:2:.*aux.*W32' stderr
+am_warn_unportable_auxdir ()
+{
+  details=$1
+  AUTOMAKE_fails
+  command_ok_ \
+    "warn about $details unportable auxdir name" \
+    grep '^configure\.in:2:.*aux.*W32' stderr
+}
+
+$ACLOCAL || fatal_ "aclocal failed"
+
+am_warn_unportable_auxdir "non-existent"
 
 if mkdir aux; then
-  AUTOMAKE_fails
-  grep '^configure\.in:2:.*aux.*W32' stderr
+  am_warn_unportable_auxdir "existent"
+else
+  skip_row_ 2 -r "cannot create directory named 'aux'"
 fi
 
 :
index ea51cf5a154592b3eb285a3ab8a85e61891d93fa..de8bcc47081656ee586d72206e0133a0f28cbf68 100755 (executable)
@@ -36,5 +36,9 @@ END
 
 $ACLOCAL
 AUTOMAKE_fails
-$FGREP CC stderr
-$FGREP CXX stderr
+grep ' C source.*CC.* undefined' stderr
+grep 'define .*CC.* add .*AC_PROG_CC' stderr
+grep ' C++ source.*CXX.* undefined' stderr
+grep 'define .*CXX.* add .*AC_PROG_CXX' stderr
+
+:
index d7f61d6cfcffd26c35c26b7c365beedffa29269d..f681f06c54cd40ba6c556c7ebeb20691b9b319be 100755 (executable)
@@ -51,7 +51,7 @@ command_ok_ "override of \$me before ./defs causes no error" \
 r='ok'
 printf '%s\n' "$s" | grep '^me=foo\.test$' || r='not ok'
 printf '%s\n' "$s" | grep 'me=bad'         && r='not ok'
-result_ "$r" "override of \$me before defs is honored"
+result_ "$r" "override of \$me before ./defs is honored"
 unset r
 
 # Overriding $me after sourcing ./defs-static should work.
index f583e365a164cfeea34a5954b5bcceb16d75cdc8..430a3501a76b4692ab6eb323e952b49932e22dee 100755 (executable)
@@ -31,7 +31,7 @@ AUTOMAKE_OPTIONS = subdir-objects
 SUFFIXES = .baz .o
 # We fake here:
 .baz.o:
-       ## Account for VPATH issues on weaker make implementations.
+## Account for VPATH issues on weaker make implementations.
        cp `test -f '$<' || echo $(srcdir)/`$< $@
 
 bin_PROGRAMS = foo
index 149717dd82c8a73e8593b2089a3cabb612a4f3a3..7d1d7b5fffc0ad38c7926ae98052c00d6311b509 100755 (executable)
@@ -31,6 +31,8 @@ AC_SUBST([OBJEXT])
 AC_OUTPUT
 END
 
+unset OBJEXT || :
+
 cat > Makefile.am << 'END'
 SUFFIXES = .zoo .o .obj .@OBJEXT@
 
index 5ecd4ab040f587386a6bfe815c38c09147fec0a7..790c5660a216ac9e67c7f0d4af2344057e09e1a8 100755 (executable)
 # Make sure we get an error if symlink creation fails.
 # Reported by Joerg-Martin Schwarz.
 
+am_create_testdir=empty
 . ./defs || Exit 1
 
-rm -f install-sh
-rm -f mkinstalldirs
-
 : > Makefile.am
 
 cat > configure.in << 'END'
 AC_INIT([symlink], [1.0])
-AC_CONFIG_AUX_DIR(sub)
+AC_CONFIG_AUX_DIR([subdir])
 AM_INIT_AUTOMAKE
 AC_CONFIG_FILES([Makefile])
 END
 
 $ACLOCAL
 AUTOMAKE_fails --add-missing
-grep 'error while making link' stderr
+
+grep '^configure\.in:3: .*missing.*error while making link' stderr
+grep '^configure\.in:3: .*install-sh.*error while making link' stderr
+
+test `$FGREP -c 'error while making link' stderr` -eq 2
+
+:
index ba9249ea3878bce92a46f7950555eb4ead76d4df..78341366b65d9aaab5a73bfebcead5ca0ce683d5 100755 (executable)
 cat > Makefile.am << 'END'
 foo = q \
 
-lib_LTLIBRARIES = foo.la
+bar = z
 END
 
 $ACLOCAL
 AUTOMAKE_fails
-grep 'Makefile\.am:2:.*blank line' stderr
+grep '^Makefile\.am:2:.*blank line follow.* trailing backslash' stderr
 
 :
index 4fb023c73f5f224f527a07e47c10f108ee4cd15a..da155978149f5265ee304e7c17516fed79a3b679 100755 (executable)
@@ -149,7 +149,7 @@ for vpath in : false; do
 
   # Check that the content of, and only of, the test logs with at least
   # one failing test case has been copied into `test-suite.log'.  Note
-  # that test logs containing skipped or failed test cases are *not*
+  # that test logs containing skipped or xfailed test cases are *not*
   # copied into `test-suite.log' -- a behaviour that deliberately differs
   # from the one of the built-in Automake test drivers.
   grep '%%' test-suite.log # For debugging.
index 57ff90928fa77b357619b5fcfa5bc0ddb21bf7f6..f19506c8972a78ed74d64a058d84758644bef657 100755 (executable)
@@ -26,7 +26,6 @@ END
 
 cat > Makefile.am << 'END'
 LOG_COMPILER = true
-empty =
 TESTS = x0 foo bar baz x1
 EXTRA_DIST = $(TESTS)
 END
index 5b6ff23f4f919d2904a1c1e268d6f5fb7cdcd0e1..29dd575a347e388da19efbb20e6c645b1f5c60b7 100755 (executable)
@@ -43,34 +43,22 @@ cat stderr >&2
 # Lines number are printed in error message.
 # Use them to make sure errors are diagnosed against the right lines.
 
-# No error expected for these lines.
-grep 1: stderr
-grep 2: stderr && Exit 1
-grep 3: stderr && Exit 1
-grep 4: stderr
-grep 5: stderr
-grep 6: stderr && Exit 1
-grep 7: stderr
-grep 8: stderr
-grep 9: stderr
-grep 10: stderr && Exit 1
-grep 11: stderr && Exit 1
-grep 12: stderr && Exit 1
+# No error expected apart from those on these lines.
+grep -v '^Makefile\.am:[145789]:' stderr | grep . && Exit 1
 
 # Now check some individual values.
-grep 'shell echo' stderr
+grep ':1:.*shell echo' stderr
 grep 'nextvariableisbad' stderr && Exit 1
-grep 'addsuffix' stderr
-grep 'bad boy' stderr
-grep 'ok' stderr && Exit 1
-grep 'three errors' stderr
-grep 'on this' stderr
-grep 'long line' stderr
-grep 'o u c h' stderr
-grep 'wildcard' stderr
-grep 'another Error' stderr
-grep 'thisis' stderr && Exit 1
-grep 'here' stderr && Exit 1
+grep ':4:.*addsuffix' stderr
+grep ':5:.*bad boy' stderr
+grep ':7:.*three errors' stderr
+grep ':7:.*on this' stderr
+grep ':7:.*long line' stderr
+grep ':8:.*o u c h' stderr
+grep ':8:.*wildcard' stderr
+grep ':9:.*another Error' stderr
+
+$EGREP 'ok|thisis|here' stderr && Exit 1
 
 # None of these errors be diagnosed with `-Wno-portability'.
 $AUTOMAKE -Wno-portability
index ca87e3624ae0c15677042562221f3cf99127fcf4..a7b6ca36cc882507c540a1e7353f65500f129c47 100755 (executable)
 
 amver=`$AUTOMAKE --version | sed -e 's/.* //;1q'`
 
+# Does the extracted version number seems legit?
+case $amver in
+  *[0-9].[0-9]*) ;;
+  *) fatal_ "couldn't extract version number from automake" ;;
+esac
+
 cat > Makefile.am << END
 AUTOMAKE_OPTIONS = $amver
 END
 
 $ACLOCAL
 $AUTOMAKE
+
+:
index 4cbd5a18269a34fd84963fd44375132fbef17cb2..76d3a5370707c15f9fdbd26badd230f58af0fb2f 100755 (executable)
@@ -27,5 +27,8 @@ END
 $ACLOCAL
 $AUTOMAKE
 
+grep VPATH Makefile.in # For debugging.
+grep '^VPATH = zardoz$' Makefile.in
 grep 'VPATH.*@srcdir@' Makefile.in && Exit 1
-Exit 0
+
+: