* 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.
This commit is contained in:
Thomas Fitzsimmons 2002-05-15 23:48:47 +00:00
parent dc824ef736
commit 3495f076f3
3 changed files with 119 additions and 119 deletions

View File

@ -5,9 +5,8 @@
# #
# newlib_check_output takes the basename of the test source file, and # newlib_check_output takes the basename of the test source file, and
# a list of pairs of the form "testname" "expectedoutput" # a list of TCL regular expressions representing the expected output.
# "testname" "expectedoutput"... It assumes one line of output # It assumes one line of output per test.
# per test.
proc newlib_check_output { srcfile expectlist } { proc newlib_check_output { srcfile expectlist } {
global objdir subdir srcdir global objdir subdir srcdir
@ -19,8 +18,7 @@ proc newlib_check_output { srcfile expectlist } {
if { $comp_output != "" } { if { $comp_output != "" } {
fail "Failed to compile $srcfile.\n" fail "Failed to compile $srcfile.\n"
} else { return
pass "Compiled $srcfile.\n"
} }
set result [newlib_load $test_driver ""] set result [newlib_load $test_driver ""]
@ -29,12 +27,14 @@ proc newlib_check_output { srcfile expectlist } {
set output_lines [split $output "\n"] set output_lines [split $output "\n"]
foreach { testname expectedval } $expectlist { foreach { expectedval } $expectlist {
if [string match "$expectedval" "[lindex $output_lines 0]"] then { set gotval [string trim [lindex $output_lines 0] "\r"]
pass $testname if { ! [string match $expectedval $gotval] } {
} else { fail "$srcfile: Expected: $expectedval Got: $gotval "
fail $testname return
} }
set output_lines [lrange $output_lines 1 end] set output_lines [lrange $output_lines 1 end]
} }
pass $srcfile
} }

View File

@ -6,83 +6,83 @@
load_lib checkoutput.exp load_lib checkoutput.exp
set tests { set expected_output {
"Setting UTF-8 locale" "*Set UTF-8 locale*" "Set UTF-8 locale."
"2.1.1" "* U-00000000 *" "* U-00000000"
"2.1.2" "* U-00000080 *" "* U-00000080"
"2.1.3" "* U-00000800 *" "* U-00000800"
"2.1.4" "* U-00010000 *" "* U-00010000"
"2.1.5" "* U-00200000 *" "* U-00200000"
"2.1.6" "* U-04000000 *" "* U-04000000"
"2.2.1" "* U-0000007f *" "* U-0000007f"
"2.2.2" "* U-000007ff *" "* U-000007ff"
"2.2.3" "* U-0000ffff *" "* U-0000ffff"
"2.2.4" "* U-001fffff *" "* U-001fffff"
"2.2.5" "* U-03ffffff *" "* U-03ffffff"
"2.2.6" "* U-7fffffff *" "* U-7fffffff"
"2.3.1" "* U-0000d7ff *" "* U-0000d7ff"
"2.3.2" "* U-0000e000 *" "* U-0000e000"
"2.3.3" "* U-0000fffd *" "* U-0000fffd"
"2.3.4" "* U-0010ffff *" "* U-0010ffff"
"2.3.5" "* U-00110000 *" "* U-00110000"
"3.1.1" "* 1 Invalid *" "* 1 Invalid"
"3.1.2" "* 1 Invalid *" "* 1 Invalid"
"3.1.3" "* 2 Invalid *" "* 2 Invalid"
"3.1.4" "* 3 Invalid *" "* 3 Invalid"
"3.1.5" "* 4 Invalid *" "* 4 Invalid"
"3.1.6" "* 5 Invalid *" "* 5 Invalid"
"3.1.7" "* 6 Invalid *" "* 6 Invalid"
"3.1.8" "* 7 Invalid *" "* 7 Invalid"
"3.1.9" "* 64 Invalid *" "* 64 Invalid"
"3.2.1" "* 32 Invalid *" "* 32 Invalid"
"3.2.2" "* 16 Invalid *" "* 16 Invalid"
"3.2.3" "* 8 Invalid *" "* 8 Invalid"
"3.2.4" "* 4 Invalid *" "* 4 Invalid"
"3.2.5" "* 2 Invalid *" "* 2 Invalid"
"3.3.1" "* 1 Invalid *" "* 1 Invalid"
"3.3.2" "* 1 Invalid *" "* 1 Invalid"
"3.3.3" "* 1 Invalid *" "* 1 Invalid"
"3.3.4" "* 1 Invalid *" "* 1 Invalid"
"3.3.5" "* 1 Invalid *" "* 1 Invalid"
"3.3.6" "* 1 Invalid *" "* 1 Invalid"
"3.3.7" "* 1 Invalid *" "* 1 Invalid"
"3.3.8" "* 1 Invalid *" "* 1 Invalid"
"3.3.9" "* 1 Invalid *" "* 1 Invalid"
"3.3.10" "* 1 Invalid *" "* 1 Invalid"
"3.5.1" "* 1 Invalid *" "* 1 Invalid"
"3.5.2" "* 1 Invalid *" "* 1 Invalid"
"3.5.3" "* 1 Invalid *" "* 1 Invalid"
"4.1.1" "* 1 Invalid *" "* 1 Invalid"
"4.1.2" "* 1 Invalid *" "* 1 Invalid"
"4.1.3" "* 1 Invalid *" "* 1 Invalid"
"4.1.4" "* 1 Invalid *" "* 1 Invalid"
"4.1.5" "* 1 Invalid *" "* 1 Invalid"
"4.2.1" "* 1 Invalid *" "* 1 Invalid"
"4.2.2" "* 1 Invalid *" "* 1 Invalid"
"4.2.3" "* 1 Invalid *" "* 1 Invalid"
"4.2.4" "* 1 Invalid *" "* 1 Invalid"
"4.2.5" "* 1 Invalid *" "* 1 Invalid"
"4.3.1" "* 1 Invalid *" "* 1 Invalid"
"4.3.2" "* 1 Invalid *" "* 1 Invalid"
"4.3.3" "* 1 Invalid *" "* 1 Invalid"
"4.3.4" "* 1 Invalid *" "* 1 Invalid"
"4.3.5" "* 1 Invalid *" "* 1 Invalid"
"5.1.1" "* 1 Invalid *" "* 1 Invalid"
"5.1.2" "* 1 Invalid *" "* 1 Invalid"
"5.1.3" "* 1 Invalid *" "* 1 Invalid"
"5.1.4" "* 1 Invalid *" "* 1 Invalid"
"5.1.5" "* 1 Invalid *" "* 1 Invalid"
"5.1.6" "* 1 Invalid *" "* 1 Invalid"
"5.1.7" "* 1 Invalid *" "* 1 Invalid"
"5.2.1" "* 1 Invalid *" "* 1 Invalid"
"5.2.2" "* 1 Invalid *" "* 1 Invalid"
"5.2.3" "* 1 Invalid *" "* 1 Invalid"
"5.2.4" "* 1 Invalid *" "* 1 Invalid"
"5.2.5" "* 1 Invalid *" "* 1 Invalid"
"5.2.6" "* 1 Invalid *" "* 1 Invalid"
"5.2.7" "* 1 Invalid *" "* 1 Invalid"
"5.3.1" "* 1 Invalid *" "* 1 Invalid"
"5.3.2" "* 1 Invalid *" "* 1 Invalid"
} }
newlib_check_output "UTF-8.c" "$tests" newlib_check_output UTF-8.c $expected_output