automake-patches
[Top][All Lists]
Advanced

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

[FYI] {testsuite-work} lex tests: do not force the use of flex unconditi


From: Stefano Lattarini
Subject: [FYI] {testsuite-work} lex tests: do not force the use of flex unconditionally
Date: Wed, 1 Jun 2011 17:56:23 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

* tests/defs (lex): Act more similarly to what the `yacc'
requirement does, i.e., only force the use of flex if the
$LEX variable is left unset by the user.
(flex): Use `skip_' to skip the test if flex is not found.
---
 ChangeLog  |    8 ++++++++
 tests/defs |   16 ++++++++++++++--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dee08e1..c29fdd4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2011-06-01  Stefano Lattarini  <address@hidden>
 
+       lex tests: do not force the use of flex unconditionally
+       * tests/defs (lex): Act more similarly to what the `yacc'
+       requirement does, i.e., only force the use of flex if the
+       $LEX variable is left unset by the user.
+       (flex): Use `skip_' to skip the test if flex is not found.
+
+2011-06-01  Stefano Lattarini  <address@hidden>
+
        lex tests: avoid possible hang, fix, and extend
        * tests/lex3.test (foo.l:yywrap): Return 1, not 0, to avoid hangs.
        Bug introduced in commit 'v1.11-871-geb147a1'.
diff --git a/tests/defs b/tests/defs
index 1f3210c..ea036f8 100644
--- a/tests/defs
+++ b/tests/defs
@@ -520,12 +520,24 @@ do
        && test "${#_am_dummy}" -eq 5' ) \
           || skip_ "the shell lacks some required XSI features"
       ;;
-    flex|lex)
+    flex)
       # Since flex is required, we pick LEX for ./configure.
       LEX=flex
       export LEX
       echo "$me: running flex --version"
-      flex --version || exit 77
+      flex --version || skip_ "required program \`flex' not available"
+      ;;
+    lex)
+      test "$LEX" = false && skip_ "no Lex program available"
+      if test -z "$LEX"; then
+        # The user hasn't explicitly specified any lex program in the
+        # environment, so we try to use flex, skipping the test if it's
+        # not found.
+        LEX=flex
+        export LEX
+        echo "$me: running flex --version"
+        flex --version || skip_ "required program \`flex' not available"
+      fi
       ;;
     yacc)
       test "$YACC" = false && skip_ "no Yacc program available"
-- 
1.7.2.3




reply via email to

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