logo       

FYI: fix for `export amtraces=autoconf' passes :): msg#00017

sysutils.automake.patches

Subject: FYI: fix for `export amtraces=autoconf' passes :)

Except tests/ldflags.test these tests failed to fail.
In other words, they passed for the wrong reason.

I guess there are many other broken test cases like these in the
test suite. (I've just seen these because I was hunting for
LIBOBJS assignments.) Probably we should make sure that no test
ever do `$AUTOMAKE && exit 1' when a specific failure is
expected.

2002-04-12 Alexandre Duret-Lutz <duret_g@xxxxxxxx>

* tests/discover.test: Use a full configure.in that calls AC_INIT.
Use AC_LIBOBJ. Grep the error message.
* test/ldadd.test: Don't use LIBOBJS. Use a full configure.in.
Grep the error message. Require libtool.
* tests/ldflags.test: Don't use LIBOBJS.
* tests/seenc.test: Use AC_LIBOBJ, --Wno-error, and grep the
error messages for CC and CXX.

Index: tests/discover.test
===================================================================
RCS file: /cvs/automake/automake/tests/discover.test,v
retrieving revision 1.6
diff -u -r1.6 discover.test
--- tests/discover.test 28 Oct 2001 14:00:28 -0000 1.6
+++ tests/discover.test 12 Apr 2002 16:24:47 -0000
@@ -4,11 +4,11 @@

. $srcdir/defs || exit 1

-cat > configure.in << 'END'
+cat >> configure.in << 'END'
AC_PROG_RANLIB
AC_PROG_CC
-LIBOBJS="$LIBOBJS fsusage.o"
-AC_OUTPUT(Makefile)
+AC_LIBOBJ([fsusage])
+AC_OUTPUT
END

cat > Makefile.am << 'END'
@@ -20,5 +20,5 @@
: > fsusage.c

$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
+$AUTOMAKE 2>&1 | fgrep fsusage.c || exit 1
exit 0
Index: tests/ldadd.test
===================================================================
RCS file: /cvs/automake/automake/tests/ldadd.test,v
retrieving revision 1.6
diff -u -r1.6 ldadd.test
--- tests/ldadd.test 28 Oct 2001 14:00:28 -0000 1.6
+++ tests/ldadd.test 12 Apr 2002 16:24:47 -0000
@@ -2,15 +2,14 @@

# Check to make sure incorrect LDADD usage is diagnosed.

+required=libtool
. $srcdir/defs || exit 1

-cat > configure.in << 'END'
+cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_LIBTOOL
-AC_OUTPUT(Makefile)
-LTLIBOBJS="$LTLIBOBJS q.o"
-LIBOBJS="$LIBOBJS q.o"
-AC_SUBST(LTLIBOBJS)
+AC_SUBST([LTLIBOBJS], [q.lo])
+AC_OUTPUT
END

cat > Makefile.am << 'END'
@@ -26,5 +25,5 @@
: > q.c

$ACLOCAL || exit 1
-$AUTOMAKE && exit 1
+$AUTOMAKE 2>&1 | grep LDADD || exit 1
exit 0
Index: tests/ldflags.test
===================================================================
RCS file: /cvs/automake/automake/tests/ldflags.test,v
retrieving revision 1.5
diff -u -r1.5 ldflags.test
--- tests/ldflags.test 21 Oct 2001 18:03:20 -0000 1.5
+++ tests/ldflags.test 12 Apr 2002 16:24:47 -0000
@@ -5,16 +5,12 @@
required=libtool
. $srcdir/defs || exit 1

-cat > configure.in << 'END'
-AC_INIT
-AM_INIT_AUTOMAKE(no, 0)
+cat >> configure.in << 'END'
AC_PROG_CC
AC_PROG_LIBTOOL
-AC_OUTPUT(Makefile)
-LTLIBOBJS="$LTLIBOBJS q.o"
-LIBOBJS="$LIBOBJS q.o"
-AC_SUBST(LTLIBOBJS)
+AC_SUBST([LTLIBOBJS], [q.o])
AM_CONDITIONAL(USE_SWIG, :)
+AC_OUTPUT
END

cat > Makefile.am << 'END'
Index: tests/seenc.test
===================================================================
RCS file: /cvs/automake/automake/tests/seenc.test,v
retrieving revision 1.3
diff -u -r1.3 seenc.test
--- tests/seenc.test 20 Oct 2001 11:17:17 -0000 1.3
+++ tests/seenc.test 12 Apr 2002 16:24:47 -0000
@@ -5,7 +5,9 @@
. $srcdir/defs || exit 1

cat >> configure.in << 'END'
-LIBOBJS="$LIBOBJS fsusage.o mountlist.o"
+dnl AC_PROG_CC and AC_PROG_CXX missing on purpose
+AC_LIBOBJ([fsusage])
+AC_LIBOBJ([mountlist])
END

cat > Makefile.am << 'END'
@@ -18,5 +20,9 @@
: > mountlist.c

$ACLOCAL || exit 1
-$AUTOMAKE > out 2>&1 && exit 1
-exit 0
+# Use -Wno-error, because there are many error messages
+# output for this test, and we just want to make sure some of
+# them are about CC and CXX being undefined.
+$AUTOMAKE --Wno-error 2> err && exit 1
+fgrep CC err || exit 1
+fgrep CXX err || exit 1

--
Alexandre Duret-Lutz





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise