2001-01-26 13:47:53 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
# Usage: check-guile [-i GUILE-INTERPRETER] [GUILE-TEST-ARGS]
|
2009-03-27 14:03:03 -07:00
|
|
|
# If `-i GUILE-INTERPRETER' is omitted, use ${top_builddir}/meta/guile.
|
2002-02-26 10:16:57 +00:00
|
|
|
# See ${top_srcdir}/test-suite/guile-test for documentation on GUILE-TEST-ARGS.
|
2001-01-26 13:47:53 +00:00
|
|
|
#
|
|
|
|
|
# Example invocations:
|
|
|
|
|
# ./check-guile
|
|
|
|
|
# ./check-guile numbers.test
|
|
|
|
|
# ./check-guile -i /usr/local/bin/guile
|
|
|
|
|
# ./check-guile -i /usr/local/bin/guile numbers.test
|
|
|
|
|
|
2002-02-05 09:21:54 +00:00
|
|
|
set -e
|
|
|
|
|
|
2002-02-26 10:12:06 +00:00
|
|
|
top_builddir=@top_builddir_absolute@
|
2002-03-04 22:53:34 +00:00
|
|
|
top_srcdir=@top_srcdir_absolute@
|
2002-02-05 09:21:54 +00:00
|
|
|
|
2002-02-05 10:32:35 +00:00
|
|
|
TEST_SUITE_DIR=${top_srcdir}/test-suite
|
Fix hanging of popen.test
The "open-output-pipe":"no duplicate" test has been hanging, on and
off, and not completely reliably, for a few years. It's now doing so
fairly reliably for me, and investigation shows that
- the child shell process is in a tight loop (99% CPU)
- the parent Guile process is stuck calling waitpid().
The problem is that the child hasn't got the SIGPIPE that the test
intends, and so is continuing to echo "closed" forever; and Guile is
waiting for it to terminate, forever.
I haven't fully debugged the SIGPIPE problem, but it sounds very like
what Chet Ramey describes here:
http://old.nabble.com/Re%3A-SIGPIPE-not-properly-reset-with-%27trap---PIPE%27-p20985595.html.
(And my version of bash is 3.2.39.)
So, a fix should be to use something other than shell to implement the
child; and it appears that this works.
* check-guile.in (TEST_SUITE_DIR): Export.
* test-suite/tests/popen-child.scm: New script file.
* test-suite/tests/popen.test ("open-output-pipe", "no duplicate"):
Use Guile for the child process, instead of shell.
2010-06-10 23:40:41 +01:00
|
|
|
export TEST_SUITE_DIR
|
2001-01-26 13:47:53 +00:00
|
|
|
|
|
|
|
|
if [ x"$1" = x-i ] ; then
|
|
|
|
|
guile=$2
|
|
|
|
|
shift
|
|
|
|
|
shift
|
|
|
|
|
else
|
2009-03-27 14:03:03 -07:00
|
|
|
guile=${top_builddir}/meta/guile
|
2001-01-26 13:47:53 +00:00
|
|
|
fi
|
2002-02-05 10:32:35 +00:00
|
|
|
|
|
|
|
|
GUILE_LOAD_PATH=$TEST_SUITE_DIR
|
2001-03-19 22:46:21 +00:00
|
|
|
export GUILE_LOAD_PATH
|
2001-01-26 13:47:53 +00:00
|
|
|
|
|
|
|
|
if [ -f "$guile" -a -x "$guile" ] ; then
|
|
|
|
|
echo Testing $guile ... "$@"
|
2001-03-19 22:46:21 +00:00
|
|
|
echo with GUILE_LOAD_PATH=$GUILE_LOAD_PATH
|
2001-01-26 13:47:53 +00:00
|
|
|
else
|
|
|
|
|
echo ERROR: Cannot execute $guile
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2001-03-19 22:46:21 +00:00
|
|
|
# documentation searching ignores GUILE_LOAD_PATH.
|
2001-03-25 18:40:28 +00:00
|
|
|
if [ ! -f guile-procedures.txt ] ; then
|
2001-11-02 00:05:45 +00:00
|
|
|
@LN_S@ libguile/guile-procedures.txt .
|
2001-03-19 22:46:21 +00:00
|
|
|
fi
|
|
|
|
|
|
2002-02-26 10:12:06 +00:00
|
|
|
exec $guile \
|
2010-09-28 10:03:55 +02:00
|
|
|
--debug \
|
2011-02-13 10:41:44 +01:00
|
|
|
--no-auto-compile -e main -s "$TEST_SUITE_DIR/guile-test" \
|
2002-02-05 09:21:54 +00:00
|
|
|
--test-suite "$TEST_SUITE_DIR/tests" \
|
|
|
|
|
--log-file check-guile.log "$@"
|
2001-01-26 13:47:53 +00:00
|
|
|
|
|
|
|
|
# check-guile ends here
|