This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Timeout ACATS tests
- From: Rainer Orth <ro at techfak dot uni-bielefeld dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Arnaud Charlet <charlet at adacore dot com>, Laurent GUERBY <laurent at guerby dot net>
- Date: Wed, 2 Sep 2009 14:35:56 +0200 (MEST)
- Subject: PATCH: Timeout ACATS tests
The following patch uses expect to allow the ACATS tests to time out just
like everything run with DejaGnu, as lately discussed in this thread:
http://gcc.gnu.org/ml/gcc-patches/2009-06/msg01479.html
I had to make some changes to this patch:
* I leave the I/O redirection at the call sites of target_run, where it
belongs: this way, the shell does the redirection, the patch is less
intrusive and copes with cases where target_run is invoked with more than
one argument.
* The path to expect isn't hardcoded in run_test.exp, but uses the EXPECT
environment variable instead. To get this to work, we need an extra eval
in target_run, since the makefiles set EXPECT to something like
EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
echo $${rootme}/../expect/expect ; \
else echo expect ; fi`
* For this to work, both rootme and EXPECT need to be exported in
gcc-interface/Make-lang.in.
Since my Tru64 UNIX machines are not yet running again (I've recently moved
jobs), I couldn't test on them where several ACATS tests time out, but only
on sparc-sun-solaris2.11 and i386-pc-solaris2.10. Due to other breakage, I
didn't have a proper baseline, though. I'll try a proper regtest with my
recent libgfortran etc. fixes just now.
Ok for mainline if this passes?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
Mon Jul 27 16:02:47 2009 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
gcc/testsuite:
PR ada/18302
* ada/acats/run_all.sh (target_run): Use run_test.exp to execute
commands.
* ada/acats/run_test.exp: New file.
gcc/ada:
* gcc-interface/Make-lang.in (check-acats): Export rootme, EXPECT.
Index: ada/gcc-interface/Make-lang.in
===================================================================
--- ada/gcc-interface/Make-lang.in (revision 151177)
+++ ada/gcc-interface/Make-lang.in (working copy)
@@ -841,6 +841,8 @@
check-acats:
@test -d $(ACATSDIR) || mkdir -p $(ACATSDIR); \
+ rootme=`${PWD_COMMAND}`; export rootme; \
+ EXPECT=$(EXPECT); export EXPECT; \
if [ -z "$(CHAPTERS)" ] && [ "$(filter -j, $(MFLAGS))" = "-j" ]; \
then \
$(MAKE) $(check_acats_targets); \
Index: testsuite/ada/acats/run_all.sh
===================================================================
--- testsuite/ada/acats/run_all.sh (revision 151177)
+++ testsuite/ada/acats/run_all.sh (working copy)
@@ -13,7 +13,7 @@
gnatflags="-gnatws"
target_run () {
-$*
+ eval $EXPECT -f $testdir/run_test.exp $*
}
# End of customization section.
Index: testsuite/ada/acats/run_test.exp
===================================================================
--- testsuite/ada/acats/run_test.exp (revision 0)
+++ testsuite/ada/acats/run_test.exp (revision 0)
@@ -0,0 +1,13 @@
+#!/usr/bin/expect -f
+
+if {[info exists env(DEJAGNU_TIMEOUT)]} {
+ set timeout $env(DEJAGNU_TIMEOUT)
+} else {
+ set timeout 300
+}
+
+spawn $argv
+expect timeout {
+ send_user "Program timed out.\n"
+ exit 1
+}