[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep-2.6: source code errors and environment-variable confusion
From: |
Jim Meyering |
Subject: |
Re: grep-2.6: source code errors and environment-variable confusion |
Date: |
Fri, 26 Mar 2010 11:26:28 +0100 |
Nelson H. F. Beebe wrote:
> Builds of grep-2.6 with native (non-gcc) compilers fail on several
> systems because of source code errors:
>
> CC grep.o
> "grep.c", line 10: void function cannot return value
> "grep.c", line 16: void function cannot return value
> "grep.c", line 22: void function cannot return value
> cc: acomp failed for grep.c
>
> On at least one system, I got a failure of the foad1 test.
> Examination of the saved output showed that the differences were from
> colorization; once I did a
>
> unsetenv GREP_COLOR
There. Fixed with these two more patches:
>From d06078aef747928c4c4f1a0a3091bb262bc96dcf Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 26 Mar 2010 11:21:11 +0100
Subject: [PATCH 1/2] tests: convert foad1.sh to use init.sh
This fixes a spurious test failure when "make check" is run with
certain envvars set, e.g., "make check GREP_COLOR=always"
* tests/foad1.sh: Use init.sh and adapt accordingly:
Use "grep", not ${GREP}. Test VERBOSE against "yes", not "1",
to be consistent with init.sh.
Use Exit, not exit.
Reported by Nelson H. F. Beebe.
---
THANKS | 1 +
tests/foad1.sh | 16 ++++++++--------
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/THANKS b/THANKS
index 084ded1..f7d8970 100644
--- a/THANKS
+++ b/THANKS
@@ -59,6 +59,7 @@ Martin Rex <address@hidden>
Michael Aichlmayr <address@hidden>
Mike Frysinger <address@hidden>
Miles Bader <address@hidden>
+Nelson H. F. Beebe <address@hidden>
Olaf Kirch <address@hidden>
Paolo Bonzini <address@hidden>
Paul Eggert <address@hidden>
diff --git a/tests/foad1.sh b/tests/foad1.sh
index 68acc77..150c2b0 100755
--- a/tests/foad1.sh
+++ b/tests/foad1.sh
@@ -9,9 +9,9 @@
#
# This set of tests was started by Julian Foad.
-: ${GREP=../src/grep}
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ ../src
-: ${VERBOSE=} # empty or "1"
failures=0
# grep_test INPUT EXPECTED_OUTPUT PATTERN_AND_OPTIONS...
@@ -23,9 +23,9 @@ grep_test ()
INPUT="$1"
EXPECT="$2"
shift 2
- OUTPUT=`printf %s "$INPUT" | tr "/" "\n" | "$GREP" "$@" | tr "\n" "/"`
- if test "$OUTPUT" != "$EXPECT" || test "$VERBOSE" = "1"; then
- echo "Testing: $GREP $@"
+ OUTPUT=`printf %s "$INPUT" | tr "/" "\n" | grep "$@" | tr "\n" "/"`
+ if test "$OUTPUT" != "$EXPECT" || test "$VERBOSE" = "yes"; then
+ echo "Testing: grep $@"
test "$LC_ALL" != C && test "$LC_ALL" != "" && echo " LC_ALL: \"$LC_ALL\""
echo " input: \"$INPUT\""
echo " output: \"$OUTPUT\""
@@ -139,12 +139,12 @@ grep_test "$x3" "$y3" -E -w --color=always bc
grep_test "$x3" "$y3" -F -w --color=always bc
# Skip the rest of the tests - known to fail. TAA.
-exit $failures
+Exit $failures
# The rest of this file is meant to be executed under this locale.
LC_ALL=cs_CZ.UTF-8; export LC_ALL
# If the UTF-8 locale doesn't work, skip these tests silently.
-locale -k LC_CTYPE 2>/dev/null | "${GREP}" -q "charmap.*UTF-8" || exit
$failures
+locale -k LC_CTYPE 2>/dev/null | grep -q "charmap.*UTF-8" || Exit $failures
# Test character class erroneously matching a '[' character.
grep_test "[/" "" "[[:alpha:]]" -E
@@ -202,4 +202,4 @@ done
# Insert them before LC_ALL is set above to avoid this.
# Leave this comment last.
-exit $failures
+Exit $failures
--
1.7.0.3.448.g82eeb
>From 0b027cfbadb1c01152c552927352b9e06f5241fc Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 26 Mar 2010 11:22:16 +0100
Subject: [PATCH 2/2] tests: rename: foad1.sh -> foad1
* tests/foad1.sh: Rename to ...
* tests/foad1: ...this, dropping the .sh suffix.
* tests/Makefile.am (TESTS): Reflect renaming.
---
tests/Makefile.am | 2 +-
tests/{foad1.sh => foad1} | 0
2 files changed, 1 insertions(+), 1 deletions(-)
rename tests/{foad1.sh => foad1} (100%)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 17785bb..8884daf 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -31,7 +31,7 @@ TESTS = \
fedora \
file.sh \
fmbtest.sh \
- foad1.sh \
+ foad1 \
help-version \
khadafy.sh \
max-count-vs-context \
diff --git a/tests/foad1.sh b/tests/foad1
similarity index 100%
rename from tests/foad1.sh
rename to tests/foad1
--
1.7.0.3.448.g82eeb