automake-patches
[Top][All Lists]
Advanced

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

FYI: Add specflags{7,8}.test (one XFAIL)


From: Alexandre Duret-Lutz
Subject: FYI: Add specflags{7,8}.test (one XFAIL)
Date: Tue, 02 Apr 2002 15:11:31 +0200
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-debian-linux-gnu)

I'm checkin these two test cases in.
They are both based on the ctags/etags example from the manual.

specflags7.test additionally tests for _SHORTNAME (there was no
  such test in the testsuite).

specflags8.test try to define the common source files in a
variable.  This fails with the following output, where we can
see that both executables are built with the same object file:

source='etags.c' object='etags.o' libtool=no \
depfile='.deps/etags.Po' tmpdepfile='.deps/etags.TPo' \
depmode=gcc /bin/sh ./depcomp \
gcc -DPACKAGE_NAME=\"specflags8\" -DPACKAGE_TARNAME=\"specflags8\" 
-DPACKAGE_VERSION=\"1.0\" -DPACKAGE_STRING=\"specflags8\ 1.0\" 
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"specflags8\" -DVERSION=\"1.0\"  -I. -I.    
 -g -O2 -c `test -f 'etags.c' || echo './'`etags.c
gcc  -g -O2   -o etags  etags.o
gcc  -g -O2   -o ctags  etags.o
XFAIL: specflags8.test

Index: ChangeLog
===================================================================
RCS file: /cvs/automake/automake/ChangeLog,v
retrieving revision 1.1801
diff -u -r1.1801 ChangeLog
--- ChangeLog   2002/03/30 00:31:43     1.1801
+++ ChangeLog   2002/04/02 12:58:55
@@ -1,3 +1,9 @@
+2002-04-02  Alexandre Duret-Lutz  <address@hidden>
+
+       * tests/specflags7.test, tests/specflags8.test: New files.
+       * tests/Makefile.am (TESTS): Add them.
+       (XFAIL_TESTS): Add specflags8.test.
+
 2002-03-29  Tom Tromey  <address@hidden>
 
        * automake.in (check_typos): Examine AM_LDFLAGS.
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.383
diff -u -r1.383 Makefile.am
--- Makefile.am 2002/03/30 00:26:06     1.383
+++ Makefile.am 2002/04/02 12:58:55
@@ -1,6 +1,6 @@
 ## Process this file with automake to create Makefile.in
 
-XFAIL_TESTS = condd.test subdir5.test auxdir2.test cond17.test
+XFAIL_TESTS = condd.test subdir5.test auxdir2.test cond17.test specflags8.test
 
 TESTS =        \
 acinclude.test \
@@ -292,6 +292,8 @@
 specflags.test \
 specflags2.test        \
 specflags3.test        \
+specflags7.test        \
+specflags8.test        \
 spell.test \
 spell2.test \
 spell3.test \
Index: tests/specflags7.test
===================================================================
RCS file: specflags7.test
diff -N specflags7.test
--- /dev/null   Tue May  5 13:32:27 1998
+++ specflags7.test     Tue Apr  2 04:58:55 2002
@@ -0,0 +1,47 @@
+#! /bin/sh
+
+# The ctags/etags example from the manual, plus a check for _SHORTNAME.
+
+. $srcdir/defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = etags ctags
+ctags_SOURCES = etags.c
+ctags_CFLAGS = -DCTAGS
+ctags_SHORTNAME = c
+# No etags_SOURCES definition.  Use the default source.
+etags_CFLAGS = -DETAGS
+etags_SHORTNAME = e
+END
+
+cat > etags.c << 'END'
+#include <stdio.h>
+int
+main (int argc, char *argv[])
+{
+#ifdef CTAGS
+   puts ("ctags");
+#else
+   puts ("etags");
+#endif
+   return 0;
+}
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE
+./ctags | grep ctags
+./etags | grep etags
+test -f ./c-etags.o
+test -f ./e-etags.o
Index: tests/specflags8.test
===================================================================
RCS file: specflags8.test
diff -N specflags8.test
--- /dev/null   Tue May  5 13:32:27 1998
+++ specflags8.test     Tue Apr  2 04:58:55 2002
@@ -0,0 +1,49 @@
+#! /bin/sh
+
+# Like the ctags/etags example from the manual,
+# with one extra indirection in the sources.
+
+. $srcdir/defs || exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+# Using a separate variable to hold all the sources for a program is
+# common when building many flavors of this program, each with
+# different flags.
+
+cat > Makefile.am << 'END'
+ETAGSSOURCE = etags.c
+bin_PROGRAMS = etags ctags
+ctags_SOURCES = $(ETAGSSOURCE)
+ctags_CXXFLAGS = -DCTAGS
+etags_SOURCES = $(ETAGSSOURCE)
+etags_CXXFLAGS = -DETAGS
+END
+
+cat > etags.c << 'END'
+#include <stdio.h>
+int
+main (int argc, char *argv[])
+{
+#ifdef CTAGS
+   puts ("ctags");
+#else
+   puts ("etags");
+#endif
+   return 0;
+}
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE
+./ctags | grep ctags
+./etags | grep etags

-- 
Alexandre Duret-Lutz




reply via email to

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