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
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 \
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 \
# 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
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
:
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"
:
required=cc
. ./defs || Exit 1
+plan_ 10
+
cat >>configure.in <<EOF
AC_PROG_CC
AC_OUTPUT
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
:
required=c++
. ./defs || Exit 1
+plan_ 10
+
cat >> configure.in << 'END'
AC_PROG_CXX
AC_OUTPUT
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
:
required='cc libtoolize'
. ./defs || Exit 1
+plan_ 10
+
cat >>configure.in <<'END'
AM_PROG_LIBTOOL
AC_OUTPUT
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
: