automake-patches
[Top][All Lists]
Advanced

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

[PATCH] tests: fix spurious failures in yflags*.test


From: Stefano Lattarini
Subject: [PATCH] tests: fix spurious failures in yflags*.test
Date: Sat, 22 Jan 2011 13:57:45 +0100
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

Hello automakers.

Hmpf.  The tests `yflags.test' and `yflags2.test' fail if an environment
variable YACC is defined, because they call `make -e', thus letting the
value of that variable override the value we forced at configure time.

The attached patch fixes this.

OK for a temporary branch yflags-test-fixes (stemming out of commit
v1.11-136-gfee7d0d "Fix minor testsuite issues, update docs, for
Yacc/Lex changes"), to be merged into maint and yacc-work?

Regards,
  Stefano
From 1680438e8fdc9f390719c45604e744e9aab8ca5d Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Sat, 22 Jan 2011 13:32:14 +0100
Subject: [PATCH] tests: fix spurious failures in yflags*.test

* tests/yflags.test: Export 'YACC=fake-yacc' in the environment,
instead of having it AC_SUBST'd in configure.in.  This fixes
spurious failures occurring when a 'YACC' variable is already
exported in the environment (due to our use of `make -e').
(configure.in): Call AC_PROG_YACC, instead of hard-coding
definition and AC_SUBSTitution of 'YACC'.
* tests/yflags2.test: Likewise.
---
 ChangeLog          |   11 +++++++++++
 tests/yflags.test  |   11 +++++++----
 tests/yflags2.test |   11 +++++++----
 3 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 98e5792..149dd01 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-01-22  Stefano Lattarini  <address@hidden>
+
+       tests: fix spurious failures in yflags*.test
+       * tests/yflags.test: Export 'YACC=fake-yacc' in the environment,
+       instead of having it AC_SUBST'd in configure.in.  This fixes
+       spurious failures occurring when a 'YACC' variable is already
+       exported in the environment (due to our use of `make -e').
+       (configure.in): Call AC_PROG_YACC, instead of hard-coding
+       definition and AC_SUBSTitution of 'YACC'.
+       * tests/yflags2.test: Likewise.
+
 2010-06-21  Ralf Wildenhues  <address@hidden>
 
        Fix minor testsuite issues, update docs, for Yacc/Lex changes.
diff --git a/tests/yflags.test b/tests/yflags.test
index fcb0c64..1dc0739 100755
--- a/tests/yflags.test
+++ b/tests/yflags.test
@@ -23,17 +23,20 @@
 
 set -e
 
-cat >fake-yacc <<'END'
+mkdir bin
+cat > bin/fake-yacc <<'END'
 #!/bin/sh
 echo '/*' "$*" '*/' >y.tab.c
 echo 'extern int dummy;' >> y.tab.c
 END
-chmod a+x fake-yacc
+chmod a+x bin/fake-yacc
+PATH=`pwd`/bin:$PATH_SEPARATOR$PATH
+
+YACC=fake-yacc; export YACC
 
 cat >> configure.in <<'END'
 AC_PROG_CC
-# Simulate presence of Yacc using our fake-yacc script.
-AC_SUBST([YACC], ['$(abs_top_srcdir)'/fake-yacc])
+AC_PROG_YACC
 AC_OUTPUT
 END
 
diff --git a/tests/yflags2.test b/tests/yflags2.test
index 346c2e4..3635c0d 100755
--- a/tests/yflags2.test
+++ b/tests/yflags2.test
@@ -24,17 +24,20 @@ required=g++ # FIXME: any working C++ compiler should be OK
 
 set -e
 
-cat >fake-yacc <<'END'
+mkdir bin
+cat > bin/fake-yacc <<'END'
 #!/bin/sh
 echo '/*' "$*" '*/' >y.tab.c
 echo 'extern int dummy;' >> y.tab.c
 END
-chmod a+x fake-yacc
+chmod a+x bin/fake-yacc
+PATH=`pwd`/bin:$PATH_SEPARATOR$PATH
+
+YACC=fake-yacc; export YACC
 
 cat >> configure.in <<'END'
 AC_PROG_CXX
-# Simulate presence of Yacc using our fake-yacc script.
-AC_SUBST([YACC], ['$(abs_top_srcdir)'/fake-yacc])
+AC_PROG_YACC
 AC_OUTPUT
 END
 
-- 
1.7.2.3


reply via email to

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