2 # every test should always be run and always return some status.
3 # so, if we lose sync with a multi-test program, aborted will be used
4 # to flag the remainder of the tests as untested.
7 # only match with color codes since "failed" / "OK" might otherwise
8 # be part of the output...
13 proc onesimple { test_name match } {
18 untested "$testprefix$test_name"
22 send_user "$testprefix$test_name$note\n"
25 "$match" { pass "$testprefix$test_name"; }
26 eof { fail "$testprefix$test_name"; set aborted 1; }
27 timeout { unresolved "$testprefix$test_name"; set aborted 1; }
31 proc onetest { test_name note start } {
39 untested "$testprefix$test_name"
44 send_user "$testprefix$test_name$note\n"
49 eof { unresolved "$testprefix$test_name"; set aborted 1; }
50 timeout { unresolved "$testprefix$test_name"; set aborted 1; }
54 send_user "sync failed: $testprefix$test_name$note -- $testprefix aborted!\n"
59 set pat "(32mOK|31mfailed)"
64 # need this because otherwise expect will skip over a "failed" and
65 # grab the next "OK" (or the other way around)
67 if { "$expect_out(0,string)" == "32mOK" || "$expect_out(0,string)" == "OK" } {
68 pass "$testprefix$test_name"
71 xfail "$testprefix$test_name"
73 fail "$testprefix$test_name"
79 eof { unresolved "$testprefix$test_name"; set aborted 1; }
80 timeout { unresolved "$testprefix$test_name"; set aborted 1; }
84 send_user "failed: $testprefix$test_name$note -- $testprefix aborted!\n"
89 proc headerline { line } {
91 if { $aborted > 0 } { return; }
94 eof { send_user "numbering mismatch!\n"; set aborted 1; }
95 timeout { send_user "numbering mismatch!\n"; set aborted 1; }
99 proc simpletest { start } {
100 onetest "$start" "" "$start"