aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2017-06-04 11:10:04 +1000
committerBen Elliston <bje@gnu.org>2017-06-04 11:10:04 +1000
commit97b84b250181dd470080d62738118343bf190394 (patch)
tree06f61edc39e42a478eb63c437fbf1314ac97bc4e
parentc920074240e376dd336f2ec2d56ab67d8b910ab8 (diff)
downloaddejagnu-97b84b250181dd470080d62738118343bf190394.zip
dejagnu-97b84b250181dd470080d62738118343bf190394.tar.gz
dejagnu-97b84b250181dd470080d62738118343bf190394.tar.bz2
* testsuite/runtest.all/libs.exp (process_test): Dump entire
output when there's no reportable output. * testsuite/runtest.all/remote.test (load_lib): New proc. * testsuite/runtest.all/target.test (load_lib): Same. Signed-off-by: Ben Elliston <bje@gnu.org>
-rw-r--r--ChangeLog7
-rw-r--r--testsuite/runtest.all/libs.exp22
-rw-r--r--testsuite/runtest.all/remote.test5
-rw-r--r--testsuite/runtest.all/target.test5
4 files changed, 38 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index bf804e3..1a1334d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-06-04 Tom de Vries <tom@codesourcery.com>
+
+ * testsuite/runtest.all/libs.exp (process_test): Dump entire
+ output when there's no reportable output.
+ * testsuite/runtest.all/remote.test (load_lib): New proc.
+ * testsuite/runtest.all/target.test (load_lib): Same.
+
2017-03-11 Thomas Preud'homme <thomas.preudhomme@arm.com>
* lib/remote.exp (remote_download): Add logging message when
diff --git a/testsuite/runtest.all/libs.exp b/testsuite/runtest.all/libs.exp
index 7520e12..068be57 100644
--- a/testsuite/runtest.all/libs.exp
+++ b/testsuite/runtest.all/libs.exp
@@ -31,7 +31,26 @@ proc process_test { test } {
if [file exists $test] {
verbose "Processing test $test" 2
- spawn -open [open "|$EXPECT $test $srcdir $subdir [pwd]" r]
+ set res [catch {
+ exec -ignorestderr \
+ $EXPECT $test $srcdir $subdir [pwd] \
+ > OUTPUT 2>ERROR
+ }]
+ if { $res } {
+ perror "$test failed" 0
+
+ set fp [open "OUTPUT" r]
+ set output [read $fp]
+ close $fp
+ puts "$test stdout: >$output<"
+
+ set fp [open "ERROR" r]
+ set error [read $fp]
+ close $fp
+ puts "$test stderr: >$error<"
+ }
+
+ spawn -open [open "|cat OUTPUT" r]
expect {
"No such file or directory" {
perror "$test wouldn't run" 0
@@ -68,6 +87,7 @@ proc process_test { test } {
verbose "All Done" 3
}
}
+ file delete OUTPUT ERROR
} else {
perror "$test doesn't exist" 0
}
diff --git a/testsuite/runtest.all/remote.test b/testsuite/runtest.all/remote.test
index 23888c6..af72664 100644
--- a/testsuite/runtest.all/remote.test
+++ b/testsuite/runtest.all/remote.test
@@ -13,6 +13,11 @@ if [ file exists $srcdir/$subdir/default_procs.tcl ] {
puts "ERROR: $srcdir/$subdir/default_procs.tcl doesn't exist"
}
+proc load_lib { lib } {
+ global srcdir
+ source "$srcdir/../lib/$lib"
+}
+
set file $srcdir/../lib/remote.exp
if [ file exists $file] {
source $file
diff --git a/testsuite/runtest.all/target.test b/testsuite/runtest.all/target.test
index 6826b26..fb30e35 100644
--- a/testsuite/runtest.all/target.test
+++ b/testsuite/runtest.all/target.test
@@ -13,6 +13,11 @@ if [ file exists $srcdir/$subdir/default_procs.tcl ] {
puts "ERROR: $srcdir/$subdir/default_procs.tcl doesn't exist"
}
+proc load_lib { lib } {
+ global srcdir
+ source "$srcdir/../lib/$lib"
+}
+
set file $srcdir/../lib/target.exp
if [ file exists $file] {
source $file