summaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-05 21:11:35 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-05 21:11:35 +0000
commit52946ab032c917905d45ebd5b7b3077b50bfb814 (patch)
tree1c2d99e4f774449ca72d334df4a080e48a051b63 /libgo
parenteb4ff2b601c1a93af8c02515111750cc891a20e2 (diff)
downloadgcc-52946ab032c917905d45ebd5b7b3077b50bfb814.tar.gz
gotest: Add external timeout if internal timeout fails.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172003 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rwxr-xr-xlibgo/testsuite/gotest15
1 files changed, 14 insertions, 1 deletions
diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest
index 650e4333c0b..cae420f4f4b 100755
--- a/libgo/testsuite/gotest
+++ b/libgo/testsuite/gotest
@@ -377,7 +377,20 @@ case "x$dejagnu" in
xno)
${GC} -g -c _testmain.go
${GL} *.o ${GOLIBS}
- ./a.out -test.short -test.timeout=$timeout "$@"
+
+ ./a.out -test.short -test.timeout=$timeout "$@" &
+ pid=$!
+ (sleep `expr $timeout + 10`
+ echo > gotest-timeout
+ echo "timed out in gotest" 1>&2
+ kill -9 $pid) &
+ alarmpid=$!
+ wait $pid
+ status=$?
+ if ! test -f gotest-timeout; then
+ kill $alarmpid
+ fi
+ exit $status
;;
xyes)
rm -rf ../testsuite/*.o