Re: Code and comments in runtest.exp that do not match [PATCH]
Jacob Bachmeyer <[email protected]>
| Newsgroups | gmane.comp.sysutils.dejagnu.general |
|---|---|
| Message-ID | <[email protected]> |
Ben Elliston wrote: > On Tue, Nov 20, 2018 at 06:07:12PM -0600, Jacob Bachmeyer wrote: > >> Tue Mar 21 09:18:15 1995 Doug Evans <[email protected]> >> >> * runtest.exp: Treat $DEJAGNU as a global config file (which it is). >> Don't exit if there isn't a global config file, just warn the user. >> Error if $DEJAGNU is defined but file doesn't exist. >> >> Which behavior is correct? The behavior described in the comments? >> What the current code actually does? >> > > It's obviosuly contradictory and the documentation doesn't say, > either, so we get to pick. :-) I think we should do what the ChangeLog > says: error if $DEJAGNU is defined but the file doesn't exist. > ChangeLog entry: ---- * runtest.exp: Raise error if $DEJAGNU is defined but not found. ---- patch: ---- diff --git a/runtest.exp b/runtest.exp index 8e6fa18..7be5a40 100644 --- a/runtest.exp +++ b/runtest.exp @@ -911,7 +911,8 @@ if {[info exists env(DEJAGNU)]} { # config file, but issue an error if $DEJAGNU is erroneously defined. # Since $DEJAGNU is set there is *supposed* to be a global config file, # so the current behaviour seems reasonable. - send_error "WARNING: global config file $env(DEJAGNU) not found.\n" + send_error "ERROR: global config file $env(DEJAGNU) not found.\n" + exit 1 } if {![info exists boards_dir]} { set boards_dir "[file dirname $env(DEJAGNU)]/boards" ---- -- Jacob