testsuite: convert some `suffix*' tests to TAP
authorStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 9 Aug 2011 17:14:13 +0000 (19:14 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 9 Aug 2011 17:15:55 +0000 (19:15 +0200)
This will allow us to explicitly declare some expected failures
involving Solaris make as such, instead of partly papering over
them with skips and partly letting them fail too loudly.

* tests/suffix-chain.test: Rename ...
* tests/suffix-chain.tap: ... to this, and convert to the use of
TAP.  Also, fix some bugs since we are at it, and ...
($required): ... require `cc'.
* tests/suffix3.test: Rename ...
* tests/suffix3.tap: ... to this, and convert to the use of TAP.
Also, since we are at it, throw in some formatting fixes.
* tests/suffix8.test: Rename ...
* tests/suffix8.tap: ... to this, and convert to the use of TAP.
Also, since we are at it, throw in some formatting fixes.
* tests/suffix10.test: Rename ...
* tests/suffix10.tap: ... to this, and convert to the use of TAP.
* tests/suffix11.test: Rename ...
* tests/suffix11.tap: ... to this, and convert to the use of TAP.
* tests/Makefile.am (TESTS): Update.

ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/suffix-chain.tap [moved from tests/suffix-chain.test with 62% similarity]
tests/suffix10.tap [moved from tests/suffix10.test with 78% similarity]
tests/suffix11.tap [moved from tests/suffix11.test with 75% similarity]
tests/suffix3.tap [moved from tests/suffix3.test with 72% similarity]
tests/suffix8.tap [moved from tests/suffix8.test with 76% similarity]

index b9b621d..394af5f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,27 @@
 2011-08-09  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       testsuite: convert some `suffix*' tests to TAP
+       This will allow us to explicitly declare some expected failures
+       involving Solaris make as such, instead of partly papering over
+       them with skips and partly letting them fail too loudly.
+       * tests/suffix-chain.test: Rename ...
+       * tests/suffix-chain.tap: ... to this, and convert to the use of
+       TAP.  Also, fix some bugs since we are at it, and ...
+       ($required): ... require `cc'.
+       * tests/suffix3.test: Rename ...
+       * tests/suffix3.tap: ... to this, and convert to the use of TAP.
+       Also, since we are at it, throw in some formatting fixes.
+       * tests/suffix8.test: Rename ...
+       * tests/suffix8.tap: ... to this, and convert to the use of TAP.
+       Also, since we are at it, throw in some formatting fixes.
+       * tests/suffix10.test: Rename ...
+       * tests/suffix10.tap: ... to this, and convert to the use of TAP.
+       * tests/suffix11.test: Rename ...
+       * tests/suffix11.tap: ... to this, and convert to the use of TAP.
+       * tests/Makefile.am (TESTS): Update.
+
+2011-08-09  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
        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
index 450848a..f2e9c2d 100644 (file)
@@ -1001,20 +1001,20 @@ substre2.test \
 substtarg.test \
 suffix.test \
 suffix2.test \
-suffix3.test \
+suffix3.tap \
 suffix4.test \
 suffix5.test \
 suffix6.test \
 suffix6b.test \
 suffix6c.test \
 suffix7.test \
-suffix8.test \
+suffix8.tap \
 suffix9.test \
-suffix10.test \
-suffix11.test \
+suffix10.tap \
+suffix11.tap \
 suffix12.test \
 suffix13.test \
-suffix-chain.test \
+suffix-chain.tap \
 symlink.test \
 symlink2.test \
 syntax.test \
index 6d0b4ac..96ade2f 100644 (file)
@@ -1244,20 +1244,20 @@ substre2.test \
 substtarg.test \
 suffix.test \
 suffix2.test \
-suffix3.test \
+suffix3.tap \
 suffix4.test \
 suffix5.test \
 suffix6.test \
 suffix6b.test \
 suffix6c.test \
 suffix7.test \
-suffix8.test \
+suffix8.tap \
 suffix9.test \
-suffix10.test \
-suffix11.test \
+suffix10.tap \
+suffix11.tap \
 suffix12.test \
 suffix13.test \
-suffix-chain.test \
+suffix-chain.tap \
 symlink.test \
 symlink2.test \
 syntax.test \
similarity index 62%
rename from tests/suffix-chain.test
rename to tests/suffix-chain.tap
index c461cc9..0ea685a 100755 (executable)
 # some make implementations to automatically chain suffix rules.
 # See automake bug#7824 and bug#7670.
 
+required=cc
 . ./defs || Exit 1
 
-cat >> configure.ac <<'END'
+plan_ 8
+
+cat >> configure.in <<'END'
 AC_PROG_CC
 AC_OUTPUT
 END
@@ -29,29 +32,33 @@ cat > Makefile.am <<'END'
 bin_PROGRAMS = foo
 foo_SOURCES = foo.e
 .e.d:
-      (echo 'int main (void)' && echo '{' && cat $<) > $@
+       (echo 'int main (void)' && echo '{' && cat $<) > $@
 .d.c:
-      (cat $< && echo '}') > $@
+       (cat $< && echo '}') > $@
 CLEANFILES = foo.d foo.c
 END
 
-echo 'return 0' > foo.e
+echo 'return 0;' > foo.e
 
-$ACLOCAL
-$AUTOMAKE
-$AUTOCONF
-./configure
+command_ok_ "aclocal"   $ACLOCAL
+command_ok_ "automake"  $AUTOMAKE
+command_ok_ "autoconf"  $AUTOCONF
+command_ok_ "configure" ./configure
 
-$MAKE
-$MAKE distcheck
+directive=''; make_can_chain_suffix_rules || directive=TODO
 
-$MAKE clean
+for target in all distcheck; do
+  if $MAKE $target; then r='ok'; else r='not ok'; fi
+  result_ "$r" -D "$directive" -r "make doesn't chain suffix rules" \
+               -- "make $target"
+done
 
+command_ok_ "clean" $MAKE clean
+# Sanity check.
 cat >> Makefile <<'END'
 foo.c: foo.d
 foo.d: foo.e
 END
-
-$MAKE
+command_ok_ "make with explicit dependencies" $MAKE
 
 :
similarity index 78%
rename from tests/suffix10.test
rename to tests/suffix10.tap
index 688976a..95c4533 100755 (executable)
@@ -54,15 +54,15 @@ cat > foo.x_ << 'END'
 int foo (void) { return yyparse(); }
 END
 
-libtoolize --force
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE --add-missing
+command_ok_ "libtoolize" libtoolize --force
+command_ok_ "aclocal"    $ACLOCAL
+command_ok_ "autoconf"   $AUTOCONF
+command_ok_ "automake"   $AUTOMAKE --add-missing
+command_ok_ "configure"  ./configure
+command_ok_ "make test"  $MAKE test
 
-./configure
-$MAKE test
-
-make_can_chain_suffix_rules || skip_ "make doesn't chain suffix rules"
-$MAKE all
+directive=''; make_can_chain_suffix_rules || directive=TODO
+if $MAKE all; then r='ok'; else r='not ok'; fi
+result_ "$r" -D "$directive" -r "make doesn't chain suffix rules" "make all"
 
 :
similarity index 75%
rename from tests/suffix11.test
rename to tests/suffix11.tap
index c69ee9e..30fa874 100755 (executable)
@@ -21,6 +21,8 @@
 required=cc
 . ./defs || Exit 1
 
+plan_ 10
+
 cat >>configure.in <<EOF
 AC_PROG_CC
 AC_OUTPUT
@@ -55,24 +57,26 @@ echo 'INTEGER main(void) { return 0; }' > bar.y-z
 echo 'INTEGER main(void) { INTEGER baz(void); return baz(); }' > baz1.x_
 echo 'INTEGER baz(void) { return 0; }' > baz2.y-z
 
-$ACLOCAL
-$AUTOCONF
+command_ok_ "aclocal" $ACLOCAL
+command_ok_ "autoconf" $AUTOCONF
 
 # What we do is not portable.  Automake should warn.
 AUTOMAKE_fails -a
-grep '[iI]nference rules can have only one target before the colon' stderr
-
+command_ok_ "warn about unportable make usage" \
+  grep '[iI]nference rules can have only one target before the colon' stderr
 # But this should work anyway.
-$AUTOMAKE -a -Wno-portability
-
-./configure
+command_ok_ "automake" $AUTOMAKE -a -Wno-portability
 
-OBJEXT=foo $MAKE -e test-fake
-$MAKE test-real
+command_ok_ "configure"  ./configure
+command_ok_ "make test-fake" env OBJEXT=foo $MAKE -e test-fake
+command_ok_ "make test-real" $MAKE test-real
 
-make_can_chain_suffix_rules || skip_ "make doesn't chain suffix rules"
+directive=''; make_can_chain_suffix_rules || directive=TODO
 
-$MAKE
-$MAKE distcheck
+for target in '' distcheck; do
+  if $MAKE $target; then r='ok'; else r='not ok'; fi
+  result_ "$r" -D "$directive" -r "make doesn't chain suffix rules" \
+               -- "make $target"
+done
 
 :
similarity index 72%
rename from tests/suffix3.test
rename to tests/suffix3.tap
index 50e5283..a4908d4 100755 (executable)
@@ -20,6 +20,8 @@
 required=c++
 . ./defs || Exit 1
 
+plan_ 10
+
 cat >> configure.in << 'END'
 AC_PROG_CXX
 AC_OUTPUT
@@ -37,42 +39,46 @@ FOO = foo
 CLEANFILES = $(FOO).cc
 END
 
-$ACLOCAL
-$AUTOMAKE
+command_ok_ "aclocal" $ACLOCAL
+command_ok_ "automake" $AUTOMAKE
 
 # The foo.cc intermediate step is implicit, it's a mistake if
 # Automake requires this file somewhere.  Also, Automake should
 # not require the file `foo.c' anywhere.
-$FGREP foo.c Makefile.in && Exit 1
+command_not_ok_ "intermediate files not mentioned" \
+  $FGREP foo.c Makefile.in
 # However Automake must figure that foo.zoo is eventually
 # transformed into foo.o, and use this latter file (to link foo).
-$FGREP 'foo.$(OBJEXT)' Makefile.in
-
-make_can_chain_suffix_rules || skip_ "make doesn't chain suffix rules"
+command_ok_ "final object file figured out" \
+  $FGREP 'foo.$(OBJEXT)' Makefile.in
 
-$AUTOCONF
-./configure
+command_ok_ "autoconf" $AUTOCONF
+command_ok_ "configure" ./configure
 
 # This is deliberately valid C++, but invalid C.
 cat > foo.zoo <<'END'
 #include <iostream>
 using namespace std;
-INTEGER main(void)
+INTEGER main (void)
 {
   return 0;
 }
 END
 
-$MAKE
+directive=''; make_can_chain_suffix_rules || directive=TODO
+
+for target in all distcheck; do
+  if $MAKE $target; then r='ok'; else r='not ok'; fi
+  result_ "$r" -D "$directive" -r "make doesn't chain suffix rules" \
+               -- "make $target"
+done
+
 # FIXME: should we check that intermediate file `foo.cc' has
 # been removed?  Or is this requiring too much from the make
 # implementation?
 
 # Intermediate files should not be distributed.
-$MAKE distdir
-test ! -r $me-1.0/foo.cc
-
-# Check the distribution.
-$MAKE distcheck
+command_ok_ "make distdir" $MAKE distdir
+command_ok_ "intermediate file not distributed" test ! -r $me-1.0/foo.cc
 
 :
similarity index 76%
rename from tests/suffix8.test
rename to tests/suffix8.tap
index 900760e..50d0967 100755 (executable)
@@ -21,6 +21,8 @@
 required='cc libtoolize'
 . ./defs || Exit 1
 
+plan_ 10
+
 cat >>configure.in <<'END'
 AM_PROG_LIBTOOL
 AC_OUTPUT
@@ -67,21 +69,23 @@ test2: $(foo_OBJECTS) $(libfoo_la_OBJECTS)
 check-local: test1 test2
 END
 
-echo 'int main(void) { return 0; }' > foo.x_
-echo 'int bar(void) { return 0; }' > bar.x_
+echo 'int main (void) { return 0; }' > foo.x_
+echo 'int bar (void) { return 0; }' > bar.x_
 
-libtoolize
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE -a
+command_ok_ "libtoolize" libtoolize
+command_ok_ "aclocal"    $ACLOCAL
+command_ok_ "autoconf"   $AUTOCONF
+command_ok_ "automake"   $AUTOMAKE -a
+command_ok_ "configure"  ./configure
+command_ok_ "make test0" env OBJEXT=foo $MAKE -e test0
+command_ok_ "make test1" $MAKE test1
 
-./configure
+directive=''; make_can_chain_suffix_rules || directive=TODO
 
-OBJEXT=foo $MAKE -e test0
-$MAKE test1
-make_can_chain_suffix_rules || skip_ "make doesn't chain suffix rules"
-$MAKE test2
-$MAKE all
-$MAKE distcheck
+for target in test2 all distcheck; do
+  if $MAKE $target; then r='ok'; else r='not ok'; fi
+  result_ "$r" -D "$directive" -r "make doesn't chain suffix rules" \
+               -- "make $target"
+done
 
 :