automake
[Top][All Lists]
Advanced

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

118-lex-tests.patch


From: Akim Demaille
Subject: 118-lex-tests.patch
Date: Sun, 01 Apr 2001 21:58:06 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * automake.in (&handle_single_transform_list): Simplify
        computation of $object and $this_obj_ext.
        * tests/lex3.test: Merge into...
        * tests/lex.test: here.
        * tests/pr19.test: Improve and rename as...
        * tests/lex3.test: this.

Index: automake.in
--- automake.in Sun, 01 Apr 2001 21:22:29 +0200 akim (am/f/39_automake.i 1.253 
755)
+++ automake.in Sun, 01 Apr 2001 21:58:49 +0200 akim (am/f/39_automake.i 1.253 
755)
@@ -1641,17 +1641,8 @@ sub handle_single_transform_list ($$$@)
             # Now extract linker and other info.
             $linker = $lang->linker;

-            my $this_obj_ext;
-            if ($lang->ansi)
-            {
-                $object = $base . $obj;
-                $this_obj_ext = $obj;
-            }
-            else
-            {
-                $object = $base . $nonansi_obj;
-                $this_obj_ext = $nonansi_obj;
-            }
+            my $this_obj_ext = $lang->ansi ? $obj : $nonansi_obj;
+           $object = $base . $this_obj_ext;

             if (defined $lang->flags
                 && &variable_defined ($derived . '_' . $lang->flags))
Index: tests/Makefile.am
--- tests/Makefile.am Sat, 31 Mar 2001 13:00:01 +0200 akim (am/f/4_Makefile.a 
1.13 644)
+++ tests/Makefile.am Sun, 01 Apr 2001 21:56:58 +0200 akim (am/f/4_Makefile.a 
1.13 644)
@@ -203,7 +203,6 @@
 ppf77.test \
 pr2.test \
 pr9.test \
-pr19.test \
 pr72.test \
 pr87.test \
 prefix.test \
Index: tests/lex.test
--- tests/lex.test Wed, 14 Mar 2001 23:12:52 +0100 akim (am/c/26_lex.test 1.2 
775)
+++ tests/lex.test Sun, 01 Apr 2001 22:19:44 +0200 akim (am/c/26_lex.test 1.3 
775)
@@ -1,10 +1,9 @@
 #! /bin/sh

-# Test to make sure that lex source generates correct target.
-
 . $srcdir/defs || exit 1

 cat >> configure.in << 'END'
+AC_INIT
 AC_PROG_CC
 AM_PROG_LEX
 END
@@ -20,4 +19,14 @@
 $ACLOCAL || exit 1
 $AUTOMAKE || exit 1

-grep '\$(LEX)' Makefile.in
+
+# Test to make sure that lex source generates correct target.
+
+fgrep '$(LEX)' Makefile.in || exit 1
+
+# Test to make sure that lex source generates correct clean rule.
+# From Ralf Corsepius.
+
+fgrep joel Makefile.in && exit 1
+
+exit 0
Index: tests/lex3.test
--- tests/lex3.test Wed, 14 Mar 2001 23:12:52 +0100 akim (am/c/24_lex3.test 1.2 
775)
+++ tests/lex3.test Sun, 01 Apr 2001 21:56:42 +0200 akim (am/c/24_lex3.test 1.2 
775)
@@ -1,25 +1,65 @@
 #! /bin/sh

-# Test to make sure that lex source generates correct clean rule.
-# From Ralf Corsepius.
+# Test associated with PR 19.
+# From Matthew D. Langston.

 . $srcdir/defs || exit 1

-cat >> configure.in << 'END'
+# Fail gracefully if no autoconf.
+$needs_autoconf
+
+# Likewise for gcc.
+(gcc -v) > /dev/null 2>&1 || exit 77
+
+# Likewise for gzip.
+(gzip --version) > /dev/null 2>&1 || exit 77
+
+cat > configure.in << 'END'
+AC_INIT
+dnl Prevent automake from looking in .. and ../..
+AC_CONFIG_AUX_DIR(.)
+AM_INIT_AUTOMAKE(am_lex_bug, 0.1.1)
+
+dnl Checks for programs.
 AC_PROG_CC
 AM_PROG_LEX
+AC_PROG_YACC
+AC_OUTPUT(Makefile)
 END

 cat > Makefile.am << 'END'
-bin_PROGRAMS = zot
-zot_SOURCES = joe.l
-LDADD = @LEXLIB@
+AUTOMAKE_OPTIONS  = foreign
+LDADD             = @LEXLIB@
+
+noinst_PROGRAMS   = foo
+foo_SOURCES       = foo.l
 END

-: > joe.l
+cat > foo.l << 'END'
+%%
+"END"   return EOF;
+.
+%%
+int
+main ()
+{
+  while (yylex () != EOF)
+    ;
+
+  return 0;
+}
+END

-$ACLOCAL || exit 1
-$AUTOMAKE || exit 1
+set -e

-fgrep joel Makefile.in && exit 1
-exit 0
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+./configure
+$MAKE
+echo 'This is the END' | ./foo
+$MAKE distcheck
+
+# foo.c must be shipped.
+gunzip am_lex_bug-0.1.1.tar.gz
+tar tf am_lex_bug-0.1.1.tar | fgrep foo.c
Index: tests/pr19.test
--- tests/pr19.test Mon, 05 Mar 2001 22:33:22 +0100 akim (am/b/21_pr19.test 1.4 
755)
+++ tests/pr19.test Sun, 01 Apr 2001 22:00:10 +0200 akim ()
@@ -1,50 +0,0 @@
-#! /bin/sh
-
-# Test associated with PR 19.
-# From Matthew D. Langston.
-
-. $srcdir/defs || exit 1
-
-cat > configure.in << 'END'
-AC_INIT(foo.l)
-dnl Prevent automake from looking in .. and ../..
-AC_CONFIG_AUX_DIR(.)
-AM_INIT_AUTOMAKE(am_lex_bug, 0.1.1)
-
-dnl Checks for programs.
-AC_PROG_CC
-AM_PROG_LEX
-AC_PROG_YACC
-
-AC_OUTPUT(Makefile)
-END
-
-cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS  = foreign
-LDADD             = @LEXLIB@
-
-noinst_PROGRAMS   = foo
-foo_SOURCES       = foo.l
-END
-
-echo %% > foo.l
-
-# Fail gracefully if no autoconf.
-$needs_autoconf
-
-# Likewise for gcc.
-(gcc -v) > /dev/null 2>&1 || exit 77
-
-# Likewise for gzip.
-(gzip --version) > /dev/null 2>&1 || exit 77
-
-$ACLOCAL || exit 1
-$AUTOCONF || exit 1
-$AUTOMAKE -a || exit 1
-CC=gcc ./configure || exit 1
-$MAKE || exit 1
-$MAKE distcheck || exit 1
-
-gunzip am_lex_bug-0.1.1.tar.gz || exit 1
-
-tar tf am_lex_bug-0.1.1.tar | fgrep foo.c



reply via email to

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