aboutsummaryrefslogtreecommitdiff
path: root/runtest.exp
diff options
context:
space:
mode:
authorJacob Bachmeyer <jcb62281@gmail.com>2018-11-15 18:21:18 +1100
committerBen Elliston <bje@gnu.org>2018-11-15 18:21:18 +1100
commitc0310e95ba22fe548fe270b4af51065aceb17dcb (patch)
treeb26d1eb04865a28dedf511b00fca6932e463b1f3 /runtest.exp
parentd6c157c0a8498dc5ae49f40f47c29f72369d05e2 (diff)
downloaddejagnu-c0310e95ba22fe548fe270b4af51065aceb17dcb.zip
dejagnu-c0310e95ba22fe548fe270b4af51065aceb17dcb.tar.gz
dejagnu-c0310e95ba22fe548fe270b4af51065aceb17dcb.tar.bz2
* runtest.exp (load_tool_init): Search for tool init file instead
of assuming exactly one location. Signed-off-by: Ben Elliston <bje@gnu.org>
Diffstat (limited to 'runtest.exp')
-rw-r--r--runtest.exp24
1 files changed, 10 insertions, 14 deletions
diff --git a/runtest.exp b/runtest.exp
index c7beeb3..5ced8ab 100644
--- a/runtest.exp
+++ b/runtest.exp
@@ -929,25 +929,21 @@ proc load_tool_init { file } {
global srcdir
global loaded_libs
- if {[info exists loaded_libs($file)]} {
+ if {[info exists loaded_libs(tool/$file)]} {
return
}
- set loaded_libs($file) ""
-
- verbose "Looking for tool init file $srcdir/lib/$file"
+ set loaded_libs(tool/$file) ""
- if {[file exists [file join ${srcdir} lib $file]]} {
- verbose "Loading library file ${srcdir}/lib/$file"
- if { [catch "uplevel #0 source ${srcdir}/lib/$file"] == 1 } {
- send_error "ERROR: tcl error sourcing library file ${srcdir}/lib/$file.\n"
- global errorInfo
- if {[info exists errorInfo]} {
- send_error "$errorInfo\n"
- }
- exit 1
- }
+ if { [lindex [file split $srcdir] end] != "testsuite" } {
+ lappend searchpath [file join $srcdir testsuite lib tool]
+ lappend searchpath [file join $srcdir testsuite lib]
} else {
+ lappend searchpath [file join $srcdir lib tool]
+ }
+ lappend searchpath [file join $srcdir lib]
+
+ if { ![search_and_load_file "tool init file" [list $file] $searchpath] } {
warning "Couldn't find tool init file"
}
}