From dc6d8b29da25a935fb8721d1ee6242687fa0eeab Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Wed, 1 Jun 2011 17:55:05 +0200 Subject: [PATCH] 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. --- ChangeLog | 8 ++++++++ tests/defs | 16 ++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 51567aa..e974a1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2011-06-01 Stefano Lattarini + 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 + 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" -- 2.7.4