aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Bachmeyer <jcb62281@gmail.com>2018-12-15 17:07:56 +1100
committerBen Elliston <bje@gnu.org>2018-12-15 17:07:56 +1100
commit9c873aea97810e61b60305b537190113bc134883 (patch)
tree0a9b68f29505605011340bd1849d944e8424f7d4
parent989c2c052a86a89dfdf95386f0f128d0443cc9cb (diff)
downloaddejagnu-9c873aea97810e61b60305b537190113bc134883.zip
dejagnu-9c873aea97810e61b60305b537190113bc134883.tar.gz
dejagnu-9c873aea97810e61b60305b537190113bc134883.tar.bz2
* testsuite/lib/runtest.exp (runtest_start): Remove.
Move the sanity check in runtest_start to top-level and similarly check to ensure that $EXPECT can be found. Make failure of either sanity check an immediate fatal error. Improve error messages for sanity checks to indicate which critical tool was not found. Remove useless 'global RUNTEST' command at top-level. (runtest_version): Brace 'if' expression. Signed-off-by: Ben Elliston <bje@gnu.org>
-rw-r--r--ChangeLog11
-rw-r--r--testsuite/lib/runtest.exp29
2 files changed, 24 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 39c02b0..60b22b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2018-12-15 Jacob Bachmeyer <jcb62281@gmail.com>
+ * testsuite/lib/runtest.exp (runtest_start): Remove.
+ Move the sanity check in runtest_start to top-level and similarly
+ check to ensure that $EXPECT can be found. Make failure of either
+ sanity check an immediate fatal error.
+ Improve error messages for sanity checks to indicate which
+ critical tool was not found. Remove useless 'global RUNTEST'
+ command at top-level.
+ (runtest_version): Brace 'if' expression.
+
+2018-12-15 Jacob Bachmeyer <jcb62281@gmail.com>
+
* testsuite/lib/runtest.exp: Use 'testsuite file' to locate the
default runtest executable instead of implicitly searching PATH.
Remove unused RUNTESTFLAGS Tcl variable.
diff --git a/testsuite/lib/runtest.exp b/testsuite/lib/runtest.exp
index 399e174..67643b4 100644
--- a/testsuite/lib/runtest.exp
+++ b/testsuite/lib/runtest.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1992-2016 Free Software Foundation, Inc.
+# Copyright (C) 1992-2016, 2018 Free Software Foundation, Inc.
#
# This file is part of DejaGnu.
#
@@ -18,16 +18,24 @@
# This file was written by Rob Savoye <rob@welcomehome.org>.
-global RUNTEST
-if {![info exists RUNTEST]} then {
+if { ![info exists RUNTEST] } {
set RUNTEST [file join [file dirname [testsuite file -source -top]] runtest]
}
-if {![info exists EXPECT]} {
+if { ![info exists EXPECT] } {
set EXPECT [findfile $base_dir/../../expect/expect $base_dir/../../expect/expect expect]
verbose "EXPECT defaulting to $EXPECT" 2
}
+if { [which $RUNTEST] == 0 } {
+ perror "Can't find RUNTEST = $RUNTEST"
+ exit 2
+}
+if { [which $EXPECT] == 0 } {
+ perror "Can't find EXPECT = $EXPECT"
+ exit 2
+}
+
#
# runtest_version -- extract and print the version number
#
@@ -35,7 +43,7 @@ proc runtest_version { } {
global RUNTEST
catch {exec $RUNTEST -V} tmp
- if [info exists tmp] then {
+ if { [info exists tmp] } {
clone_output "$tmp\n"
}
}
@@ -51,14 +59,3 @@ proc runtest_load { arg } {
#
proc runtest_exit { } {
}
-
-#
-# runtest_start -- start everything
-#
-proc runtest_start { } {
- global RUNTEST
-
- if {[which $RUNTEST] != 0} then {
- perror "Can't find $RUNTEST"
- }
-}