bison-patches
[Top][All Lists]
Advanced

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

Fix minor test case failures


From: Akim Demaille
Subject: Fix minor test case failures
Date: Tue, 21 Feb 2012 15:43:38 +0100

From 459a57a90ff6fc8209498b7d5bc6e33d5e633f23 Mon Sep 17 00:00:00 2001
From: Akim Demaille <address@hidden>
Date: Tue, 21 Feb 2012 15:38:09 +0100
Subject: [PATCH] tests: fix regressions.

Exit status 63 is documented for version-mismatch.
        * bootstrap.conf (gnulib_modules): Remove sysexits.
        * src/system.h (EX_MISMATCH): Define.
        * src/parse-gram.y (version_check): Use it instead of EX_CONFIG.

Missing includes.
        * tests/calc.at, tests/named-refs.at: Include assert.h.
---
 bootstrap.conf      |    1 -
 etc/bench.pl.in     |    2 +-
 src/parse-gram.y    |    2 +-
 src/system.h        |    3 ++-
 tests/calc.at       |    1 +
 tests/named-refs.at |    1 +
 6 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index cb3fc87..9e74861 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -25,7 +25,6 @@ gnulib_modules='
   mbswidth obstack perror pipe-posix progname
   quote quotearg realloc-posix
   spawn-pipe stdbool stpcpy strdup-posix strerror strtoul strverscmp
-  sysexits
   unistd unistd-safer unlocked-io update-copyright unsetenv verify
   warnings xalloc xalloc-die xstrndup
 
diff --git a/etc/bench.pl.in b/etc/bench.pl.in
index 0bee4df..5d83fc7 100755
--- a/etc/bench.pl.in
+++ b/etc/bench.pl.in
@@ -371,8 +371,8 @@ sub generate_grammar_calc ($$@)
     or die;
   print $out <<EOF;
 %{
+#include <assert.h>
 #include <stdio.h>
-
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
diff --git a/src/parse-gram.y b/src/parse-gram.y
index 9e5bbe6..532349b 100644
--- a/src/parse-gram.y
+++ b/src/parse-gram.y
@@ -804,7 +804,7 @@ version_check (location const *loc, char const *version)
     {
       complain_at (*loc, "require bison %s, but have %s",
                    version, PACKAGE_VERSION);
-      exit (EX_CONFIG);
+      exit (EX_MISMATCH);
     }
 }
 
diff --git a/src/system.h b/src/system.h
index a3168db..24151bb 100644
--- a/src/system.h
+++ b/src/system.h
@@ -52,7 +52,8 @@
 typedef size_t uintptr_t;
 #endif
 
-#include <sysexits.h>
+// Version mismatch.
+#define EX_MISMATCH 63
 
 /*---------.
 | Gnulib.  |
diff --git a/tests/calc.at b/tests/calc.at
index 2f35713..28e6c50 100644
--- a/tests/calc.at
+++ b/tests/calc.at
@@ -207,6 +207,7 @@ extern FILE *input;]AT_SKEL_CC_IF([[
 
 %code
 {
+#include <assert.h>
 #include <stdlib.h>
 #include <string.h>
 #if HAVE_UNISTD_H
diff --git a/tests/named-refs.at b/tests/named-refs.at
index 2490d2d..0b2f4c9 100644
--- a/tests/named-refs.at
+++ b/tests/named-refs.at
@@ -23,6 +23,7 @@ AT_SETUP([Tutorial calculator])
 AT_DATA_GRAMMAR([test.y],
 [[
 %{
+#include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-- 
1.7.9





reply via email to

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