From 3495f076f33ad9e1650517126ec4a9d306f8c9a9 Mon Sep 17 00:00:00 2001 From: Thomas Fitzsimmons Date: Wed, 15 May 2002 23:48:47 +0000 Subject: * testsuite/lib/checkoutput.exp (newlib_check_output): Output only one pass or fail per test file. Trim \r's from output values received from test programs. Remove support for named tests. * testsuite/newlib.locale/UTF-8.exp: Update to support new newlib_check_output behaviour. * testsuite/newlib.locale/UTF-8.c: Likewise. --- newlib/testsuite/lib/checkoutput.exp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'newlib/testsuite/lib') diff --git a/newlib/testsuite/lib/checkoutput.exp b/newlib/testsuite/lib/checkoutput.exp index 5793868fd..8cb46925f 100644 --- a/newlib/testsuite/lib/checkoutput.exp +++ b/newlib/testsuite/lib/checkoutput.exp @@ -5,9 +5,8 @@ # # newlib_check_output takes the basename of the test source file, and -# a list of pairs of the form "testname" "expectedoutput" -# "testname" "expectedoutput"... It assumes one line of output -# per test. +# a list of TCL regular expressions representing the expected output. +# It assumes one line of output per test. proc newlib_check_output { srcfile expectlist } { global objdir subdir srcdir @@ -19,8 +18,7 @@ proc newlib_check_output { srcfile expectlist } { if { $comp_output != "" } { fail "Failed to compile $srcfile.\n" - } else { - pass "Compiled $srcfile.\n" + return } set result [newlib_load $test_driver ""] @@ -29,12 +27,14 @@ proc newlib_check_output { srcfile expectlist } { set output_lines [split $output "\n"] - foreach { testname expectedval } $expectlist { - if [string match "$expectedval" "[lindex $output_lines 0]"] then { - pass $testname - } else { - fail $testname + foreach { expectedval } $expectlist { + set gotval [string trim [lindex $output_lines 0] "\r"] + if { ! [string match $expectedval $gotval] } { + fail "$srcfile: Expected: $expectedval Got: $gotval " + return } set output_lines [lrange $output_lines 1 end] } + + pass $srcfile } -- cgit v1.2.3