[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [DejaGnu] handling of errors in tests scripts
From: |
Martin Muenstermann |
Subject: |
Re: [DejaGnu] handling of errors in tests scripts |
Date: |
Thu, 10 May 2001 09:45:59 +0200 |
Rob Savoye wrote:
>
> On Wed, May 09, 2001 at 07:10:27PM +0200, Gabriel Dos Reis wrote:
>
> > | code of the test suite. I might make it a command line option, since
> > | I'm not sure one behaviour is any different from the other, depending
> > | on personal preference.
> >
> > I agree with you that such a behaviour should be selected through a
> > command line option.
>
> I just checked in a patch that does this. There is a new option,
> --status (or just -st) that when supplied, makes runtest propogate an error
> exit status to the shell, with the other nice side effect that you get to
> see the Tcl error message get displayed. By default, the error messages are
> hidden.
>
> Thanks for the suggestion!
Thanks for the quick implementation!
I have not tested it yet, but you should be careful about not to
overwrite a exit_status of 1 (e.g., had an FAIL before) with an
exit_error of 0 (such making pass a failed test in case of an tcl
error).
BTW:
Just tonight I was wondering if one should call a user supplied proc in
the case of an tcl error, like:
--- runtest.exp.1.4.1 Sun May 6 23:38:02 2001
+++ runtest.exp Thu May 10 09:33:58 2001
@@ -1430,6 +1430,12 @@
}
if { [catch "uplevel #0 source $test_file_name"] == 1 } {
+ # call user supplied error function
+ # (maybe this should be tool dependant: ${tool}_ontclerror?)
+ if { [info procs "ontclerror"] != "" } {
+ ontclerror $test_file_name;
+ }
+
# We can't call `perror' here, it resets `errorInfo'
# before we want to look at it. Also remember that perror
# increments `errcnt'. If we do call perror we'd have to
In this case the user could whatever he/she likes to do in this case
(setting the exit_status, sending email...).
But for me just having the command line option to set the exit_status is
OK.
Martin