This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]