Re: WARNING: Couldn't find the global config file.

Jonathan Wakely <[email protected]> Thu, 3 Dec 2020 13:39:19 +0000
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <[email protected]>
On 03/12/20 13:33 +0000, Jonathan Wakely wrote:
>The manual says "If DEJAGNU is set, but the file cannot be located, an
>error will be raised and runtest will abort." That makes sense, if I
>name a file that doesn't exist, I'm doing something wrong.

Despite the manual saying it's an error, and the comments in the code
saying it's an error, actually that's just a warning too.

     # If $DEJAGNU isn't set either then there isn't any global config file.
     # Warn the user as there really should be one.

Sooooo, not really optional then?

     if { ! [info exists env(DEJAGNU)] } {
	send_error "WARNING: Couldn't find the global config file.\n"
     }


     if { [load_file -- $env(DEJAGNU)] == 0 } {
	# It may seem odd to only issue a warning if there isn't a global
	# 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"
     }

That looks pretty similar to the case where $DEJAGNU isn't set at all.

What's going on here?