lex tests: do not force the use of flex unconditionally
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 1 Jun 2011 15:55:05 +0000 (17:55 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 1 Jun 2011 16:54:06 +0000 (18:54 +0200)
* 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
tests/defs

index 51567aa..e974a1b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2011-06-01  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       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  <stefano.lattarini@gmail.com>
+
        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'.
index 1f3210c..ea036f8 100644 (file)
@@ -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"