]> git.saurik.com Git - bison.git/commitdiff
* tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
authorAkim Demaille <akim@epita.fr>
Tue, 23 Apr 2002 09:06:42 +0000 (09:06 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 23 Apr 2002 09:06:42 +0000 (09:06 +0000)
* tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
location with columns.
* tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
All reported by Paul Eggert.

ChangeLog
tests/conflicts.at
tests/sets.at
tests/synclines.at

index c0db3880921181d07b6711f9096df44cf4b8fb69..65924bd4afb237c9a5f653fd410360db6dd7f690 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2002-04-23  Akim Demaille  <akim@epita.fr>
+
+       * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
+       * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
+       location with columns.
+       * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
+       All reported by Paul Eggert.
+
 2002-04-22  Akim Demaille  <akim@epita.fr>
 
        * src/reduce.c (dump_grammar): Move to...
index 713b49e0181f2c2ed3b762e4a2815b7609a5d7cf..e436311fde1a1913c76c3ff4d0df92e18f6bc190 100644 (file)
@@ -50,16 +50,22 @@ AT_SETUP([%nonassoc and eof])
 AT_DATA([input.y],
 [[
 %{
+#include <config.h>
+/* We don't need a perfect malloc for these tests. */
+#undef malloc
 #include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <error.h>
+
+#if STDC_HEADERS
+# include <stdlib.h>
+#endif
+
 #define YYERROR_VERBOSE 1
-#define yyerror(Msg) \
-do { \
-  fprintf (stderr, "%s\n", Msg); \
-  exit (1); \
-} while (0)
+static void
+yyerror (const char *msg)
+{
+  fprintf (stderr, "%s\n", msg);
+  exit (1);
+}
 
 /* The current argument. */
 static const char *input = NULL;
index 7203dca13532bd58fdd5e35a2f711c7ee7b5fc9f..64402c20ac99d17fc930c80f5659e459463c7d3b 100644 (file)
@@ -1,5 +1,5 @@
 # Exercising Bison Grammar Sets.                      -*- Autotest -*-
-# Copyright 2001, 2002 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,6 +16,7 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 # 02111-1307, USA.
 
+
 # AT_EXTRACT_SETS(INPUT, OUTPUT)
 # ------------------------------
 # Extract the information about the grammar sets from a bison
@@ -25,10 +26,10 @@ m4_define([AT_EXTRACT_SETS],
 [AT_DATA([extract.sed],
 [[#n
 /^NULLABLE$/ {
-   :nullable
+   :null
    p
    n
-   /^[         ]*$/! b nullable
+   /^[         ]*$/! b null
 }
 /^FIRSTS$/ {
    :firsts
@@ -37,16 +38,16 @@ m4_define([AT_EXTRACT_SETS],
    /^[         ]*$/! b firsts
 }
 /^FDERIVES$/ {
-   :fderives
+   :fderiv
    p
    n
-   /^[         ]*$/! b fderives
+   /^[         ]*$/! b fderiv
 }
 /^DERIVES$/ {
-   :derives
+   :deriv
    p
    n
-   /^[         ]*$/! b derives
+   /^[         ]*$/! b deriv
 }
 ]])
 AT_CHECK([sed -f extract.sed $1], 0, [stdout])
index c7501fdee9612d5dc415722a01f376c33ce203a1..91b91746e53ca249ace2ac9dbe53ad842e5057f3 100644 (file)
@@ -1,5 +1,5 @@
 # Executing Actions.                               -*- Autotest -*-
-# Copyright 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -33,7 +33,15 @@ AT_DATA([[input.y]],
 [$2])
 
 AT_CHECK([bison input.y -o input.c])
-AT_CHECK([$CC $CFLAGS $CPPFLAGS input.c -o input], 1, [], [$3])
+AT_CHECK([$CC $CFLAGS $CPPFLAGS input.c -o input], 1, [], [stderr])
+# In case GCC displays column information, strip it down.
+#
+#   input.y:4:2: #error "4"    or input.y:4.2: #error "4"
+# =>
+#   input.y:4: #error "4"
+#
+AT_CHECK([[sed 's/^\([^:]*:[^:.]*\)[.:][^:]*:\(.*\)$/\1:\2/' stderr]],
+         0, [$3])
 AT_CLEANUP
 ])