diff options
author | Thomas Fitzsimmons <fitzsim@redhat.com> | 2002-05-15 23:48:47 +0000 |
---|---|---|
committer | Thomas Fitzsimmons <fitzsim@redhat.com> | 2002-05-15 23:48:47 +0000 |
commit | 3495f076f33ad9e1650517126ec4a9d306f8c9a9 (patch) | |
tree | 3d02904e82e22447d4954bf4302962794d602463 /newlib/testsuite/lib | |
parent | dc824ef7363e46b3602b458f7bf00303601c1102 (diff) | |
download | cygnal-3495f076f33ad9e1650517126ec4a9d306f8c9a9.tar.gz cygnal-3495f076f33ad9e1650517126ec4a9d306f8c9a9.tar.bz2 cygnal-3495f076f33ad9e1650517126ec4a9d306f8c9a9.zip |
* 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.
Diffstat (limited to 'newlib/testsuite/lib')
-rw-r--r-- | newlib/testsuite/lib/checkoutput.exp | 20 |
1 files changed, 10 insertions, 10 deletions
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 } |