mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
examples: beware of portability issues with sh's trap
On AIX 7.2, when invoking "exit 77", we actually exit with 127. The "cleanup" function, called via trap, received an incorrect exit status, something described in Autoconf's doc. Reported by Bruno Haible. https://lists.gnu.org/archive/html/bug-bison/2020-05/msg00029.html https://lists.gnu.org/archive/html/bug-bison/2020-05/msg00047.html * examples/test (skip): New. * examples/c/bistromathic/bistromathic.test, * examples/c/reccalc/reccalc.test: Use it, to ensure $? is set to 77 when the trap is called.
This commit is contained in:
@@ -68,6 +68,20 @@ trap cleanup 0 1 2 13 15
|
||||
mkdir $$.dir
|
||||
cd $$.dir
|
||||
|
||||
|
||||
# skip [MSG]
|
||||
# ----------
|
||||
# Skip this test.
|
||||
skip ()
|
||||
{
|
||||
if test x"$1" != x; then
|
||||
echo "SKIP: $1"
|
||||
fi
|
||||
# See Autoconf's doc on 'trap'.
|
||||
(exit 77); exit 77
|
||||
}
|
||||
|
||||
|
||||
# run [-noerr, -n] EXPECTED-EXIT-STATUS EXPECTED-OUTPUT [PARSER-OPTIONS]
|
||||
# ----------------------------------------------------------------------
|
||||
# -noerr: ignore stderr, otherwise merge it into effective output.
|
||||
|
||||
Reference in New Issue
Block a user