summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2021-08-29 09:38:07 +0200
committerAkim Demaille <akim.demaille@gmail.com>2021-08-29 09:50:02 +0200
commitbc5aa8e2743e7b56818d54719bf4095a6dc09912 (patch)
treec237fb57357925f805c23c8c2801ca6253b294f2 /tests
parent0a82bf5c075fb93fe346f4ff7212dd413fb0d4ad (diff)
downloadbison-bc5aa8e2743e7b56818d54719bf4095a6dc09912.tar.gz
tests: don't postprocess stderr with sed
On Solaris, sed throws away the NUL bytes from the stream, even in C locale. So instead of postprocessing bison's stderr to neutralize changes in value of `argv[0]`, use an envvar to actually neutralize variations of `argv[0]` during tests. Reported by Dagobert Michelsen. <https://lists.gnu.org/r/bug-bison/2021-08/msg00025.html> * src/main.c (main): Change `argv[0]` if BISON_PROGRAM_NAME is defined. * tests/bison.in: No longer mess with stderr, just pass the expected BISON_PROGRAM_NAME value.
Diffstat (limited to 'tests')
-rw-r--r--tests/bison.in24
1 files changed, 5 insertions, 19 deletions
diff --git a/tests/bison.in b/tests/bison.in
index 80003aca..7732edd4 100644
--- a/tests/bison.in
+++ b/tests/bison.in
@@ -25,27 +25,13 @@ abs_top_builddir='@abs_top_builddir@'
BISON_PKGDATADIR=$abs_top_srcdir/data
export BISON_PKGDATADIR
-stderr=tmp-bison.$$
-
-# If stderr is a tty, force --color=yes to simulate --color=auto
-# although we save and modify stderr.
-if test -t 2; then
- set x --color=yes ${1+"$@"}
- shift
-fi
-
-# We redirect stderr, which breaks the computation of the terminal
-# screen width. So export COLUMNS to Bison, hoping for the shell to
-# have defined it.
-: ${COLUMNS=`(tput cols) 2>/dev/null || echo 132`}
-export COLUMNS
-$PREBISON "$abs_top_builddir/src/bison" ${1+"$@"} 2>"$stderr"
-status=$?
-
# Neutralize path differences in error messages so that check and
# installcheck behave the same way.
-sed -e "s,$abs_top_builddir/src/,,g" <"$stderr" >&2
-rm -f "$stderr"
+BISON_PROGRAM_NAME=bison
+export BISON_PROGRAM_NAME
+
+$PREBISON "$abs_top_builddir/src/bison" ${1+"$@"}
+status=$?
# As a special dark magic, if we are actually using this wrapper to
# compile Bison's src/parse-gram.y, post-process the synclines to