From 97b84b250181dd470080d62738118343bf190394 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Sun, 4 Jun 2017 11:10:04 +1000 Subject: * 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 --- ChangeLog | 7 +++++++ testsuite/runtest.all/libs.exp | 22 +++++++++++++++++++++- testsuite/runtest.all/remote.test | 5 +++++ testsuite/runtest.all/target.test | 5 +++++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bf804e3..1a1334d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2017-06-04 Tom de Vries + + * 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 * 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 -- cgit v1.1