Message ID | mcrk4f8bdys.fsf@google.com |
---|---|
State | New |
Headers | show |
diff -r 03d5aa32694e libgo/testsuite/gotest --- a/libgo/testsuite/gotest Tue Apr 05 12:52:06 2011 -0700 +++ b/libgo/testsuite/gotest Tue Apr 05 14:04:59 2011 -0700 @@ -377,7 +377,20 @@ 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