This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[ada/testsuite] Add timeout for ada tests
- From: ja2morri at csclub dot uwaterloo dot ca (James Morrison)
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 14 Nov 2005 02:51:59 -0500 (EST)
- Subject: [ada/testsuite] Add timeout for ada tests
Hi,
There are some acats tests that fill up my disk and never complete if I
let them run. So this patch adds a timeout for the acats tests.
With this patch, I get 116 acats failures on ia64-linux, but at least they
complete. Ok for mainline?
Jim
Index: run_all.sh
===================================================================
--- run_all.sh (revision 106866)
+++ run_all.sh (working copy)
@@ -12,8 +12,25 @@
gccflags="-O2"
gnatflags="-gnatws"
+if [ "x$DEJAGNU_TIMEOUT" != "x" ]; then
+ timeout=$DEJAGNU_TIMEOUT
+else
+ timeout=300
+fi
+
target_run () {
-$*
+ sh -c "
+ (sleep $timeout && kill 2>/dev/null \$\$) &
+ watchdog=\$!
+ ($*) &
+ child=\$!
+ trap \"kill 2>/dev/null \$child\" 0 1
+ wait \$child
+ status=\$?
+ trap \"\" 0 1
+ kill 2>/dev/null \$watchdog
+ exit \$status
+ "
}
# End of customization section.