automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FYI] {tap-testsuite-work} testsuite: convert some `suffix*' tests to TA


From: Stefano Lattarini
Subject: [FYI] {tap-testsuite-work} testsuite: convert some `suffix*' tests to TAP
Date: Tue, 9 Aug 2011 19:17:26 +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                                     |   22 +++++++++++++++
 tests/Makefile.am                             |   10 +++---
 tests/Makefile.in                             |   10 +++---
 tests/{suffix-chain.test => suffix-chain.tap} |   33 ++++++++++++++---------
 tests/{suffix10.test => suffix10.tap}         |   18 ++++++------
 tests/{suffix11.test => suffix11.tap}         |   28 +++++++++++--------
 tests/{suffix3.test => suffix3.tap}           |   36 ++++++++++++++----------
 tests/{suffix8.test => suffix8.tap}           |   30 +++++++++++---------
 8 files changed, 115 insertions(+), 72 deletions(-)
 rename tests/{suffix-chain.test => suffix-chain.tap} (62%)
 rename tests/{suffix10.test => suffix10.tap} (78%)
 rename tests/{suffix11.test => suffix11.tap} (75%)
 rename tests/{suffix3.test => suffix3.tap} (72%)
 rename tests/{suffix8.test => suffix8.tap} (76%)

diff --git a/ChangeLog b/ChangeLog
index b9b621d..394af5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,27 @@
 2011-08-09  Stefano Lattarini  <address@hidden>
 
+       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  <address@hidden>
+
        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
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 450848a..f2e9c2d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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 \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 6d0b4ac..96ade2f 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -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 \
diff --git a/tests/suffix-chain.test b/tests/suffix-chain.tap
similarity index 62%
rename from tests/suffix-chain.test
rename to tests/suffix-chain.tap
index c461cc9..0ea685a 100755
--- a/tests/suffix-chain.test
+++ b/tests/suffix-chain.tap
@@ -18,9 +18,12 @@
 # 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
 
 :
diff --git a/tests/suffix10.test b/tests/suffix10.tap
similarity index 78%
rename from tests/suffix10.test
rename to tests/suffix10.tap
index 688976a..95c4533 100755
--- a/tests/suffix10.test
+++ b/tests/suffix10.tap
@@ -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"
 
 :
diff --git a/tests/suffix11.test b/tests/suffix11.tap
similarity index 75%
rename from tests/suffix11.test
rename to tests/suffix11.tap
index c69ee9e..30fa874 100755
--- a/tests/suffix11.test
+++ b/tests/suffix11.tap
@@ -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
 
 :
diff --git a/tests/suffix3.test b/tests/suffix3.tap
similarity index 72%
rename from tests/suffix3.test
rename to tests/suffix3.tap
index 50e5283..a4908d4 100755
--- a/tests/suffix3.test
+++ b/tests/suffix3.tap
@@ -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
 
 :
diff --git a/tests/suffix8.test b/tests/suffix8.tap
similarity index 76%
rename from tests/suffix8.test
rename to tests/suffix8.tap
index 900760e..50d0967 100755
--- a/tests/suffix8.test
+++ b/tests/suffix8.tap
@@ -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
 
 :
-- 
1.7.2.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]