This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: How to abort a test?
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>
- Cc: Pedro Alves <palves at redhat dot com>, dejagnu at gnu dot org, gdb-patches <gdb-patches at sourceware dot org>
- Date: Sun, 17 Jan 2016 12:27:09 +0400
- Subject: Re: How to abort a test?
- Authentication-results: sourceware.org; auth=none
- References: <56958359 dot 8070708 at ericsson dot com> <5697CC09 dot 8010306 at redhat dot com> <5697D721 dot 1000305 at ericsson dot com> <5697DABA dot 8010008 at redhat dot com> <5697FA6C dot 7060703 at ericsson dot com> <5697FB9E dot 3080906 at redhat dot com> <56991FB0 dot 5090109 at ericsson dot com>
Hi Simon,
> I feel completely stupid now. Just under the line I pasted in my
> original message, there is this comment:
>
> 1474 if { [catch "uplevel #0 source $test_file_name"] == 1 } {
> 1475 # If we have a Tcl error, propogate the exit status do make
> 1476 # notices the error.
> 1477 global exit_status exit_error
> 1478 # exit error is set by a command line option
> 1479 if { $exit_status == 0 } {
> 1480 set exit_status $exit_error
> 1481 }
>
> After searching where this goes, I saw the --status argument to runtest:
>
> --status
> Set the exit status to fail on Tcl errors.
>
> Turns out we just need to add this to our runtest invocation to make
> it return non-zero when a test driver, as it calls the test .exp's,
> fails. So we just need to add this to our call to runtest (will send
> a patch later). Sometimes it can be worth it to read the man page
> first...
I admit that some of it flying a little over my head... Does it
mean that we will be able to abort a test if we detect a timeout?
This is one of the things I wanted to do, but didn't have a solution
for, so it'd be fantastic if it helped with that!
--
Joel