os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/tcltest.test
Update contrib.
1 # This file contains a collection of tests for one or more of the Tcl
2 # built-in commands. Sourcing this file into Tcl runs the tests and
3 # generates output for errors. No output means no errors were found.
5 # Copyright (c) 1998-1999 by Scriptics Corporation.
6 # Copyright (c) 2000 by Ajuba Solutions
9 # RCS: @(#) $Id: tcltest.test,v 1.37.2.11 2006/03/19 22:47:30 vincentdarley Exp $
11 # Note that there are several places where the value of
12 # tcltest::currentFailure is stored/reset in the -setup/-cleanup
13 # of a test that has a body that runs [test] that will fail.
14 # This is a workaround of using the same tcltest code that we are
15 # testing to run the test itself. Ditto on things like [verbose].
17 # It would be better to have the -body of the tests run the tcltest
18 # commands in a slave interp so the [test] being tested would not
19 # interfere with the [test] doing the testing.
22 if {[catch {package require tcltest 2.1}]} {
23 puts stderr "Skipping tests in [info script]. tcltest 2.1 required."
27 namespace eval ::tcltest::test {
29 namespace import ::tcltest::*
32 package require tcltest
33 namespace import ::tcltest::test
40 test c-1.0 {test c} {knownBug} {
49 cd [temporaryDirectory]
50 testConstraint exec [llength [info commands exec]]
52 # Child processes because -help [exit]s.
53 test tcltest-1.1 {tcltest -help} {exec} {
54 set result [catch {exec [interpreter] test.tcl -help} msg]
55 list $result [regexp Usage $msg]
57 test tcltest-1.2 {tcltest -help -something} {exec} {
58 set result [catch {exec [interpreter] test.tcl -help -something} msg]
59 list $result [regexp Usage $msg]
61 test tcltest-1.3 {tcltest -h} {exec} {
62 set result [catch {exec [interpreter] test.tcl -h} msg]
63 list $result [regexp Usage $msg]
66 # -verbose, implicit & explicit testing of [verbose]
67 proc slave {msgVar args} {
70 interp create [namespace current]::i
71 # Fake the slave interp into dumping output to a file
72 i eval {namespace eval ::tcltest {}}
73 i eval "set tcltest::outputChannel\
74 \[[list open [set of [makeFile {} output]] w]]"
75 i eval "set tcltest::errorChannel\
76 \[[list open [set ef [makeFile {} error]] w]]"
77 i eval [list set argv0 [lindex $args 0]]
78 i eval [list set argv [lrange $args 1 end]]
79 i eval [list package ifneeded tcltest [package provide tcltest] \
80 [package ifneeded tcltest [package provide tcltest]]]
81 i eval {proc exit args {}}
83 # Need to capture output in msg
85 set code [catch {i eval {source $argv0}} foo]
87 #puts "$code: $foo\n$::errorInfo"
89 i eval {close $tcltest::outputChannel}
90 interp delete [namespace current]::i
92 set msg [read -nonewline $f]
95 set err [read -nonewline $f]
99 if {[string length $err]} {
105 # return [catch {uplevel 1 [linsert $args 0 exec [interpreter]]} msg]
107 test tcltest-2.0 {tcltest (verbose default - 'b')} {unixOrPc} {
108 set result [slave msg test.tcl]
109 list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \
110 [regexp c-1.0 $msg] \
111 [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg]
113 test tcltest-2.1 {tcltest -verbose 'b'} {unixOrPc} {
114 set result [slave msg test.tcl -verbose 'b']
115 list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \
116 [regexp c-1.0 $msg] \
117 [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg]
119 test tcltest-2.2 {tcltest -verbose 'p'} {unixOrPc} {
120 set result [slave msg test.tcl -verbose 'p']
121 list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \
122 [regexp c-1.0 $msg] \
123 [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg]
125 test tcltest-2.3 {tcltest -verbose 's'} {unixOrPc} {
126 set result [slave msg test.tcl -verbose 's']
127 list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \
128 [regexp c-1.0 $msg] \
129 [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg]
131 test tcltest-2.4 {tcltest -verbose 'ps'} {unixOrPc} {
132 set result [slave msg test.tcl -verbose 'ps']
133 list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \
134 [regexp c-1.0 $msg] \
135 [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg]
137 test tcltest-2.5 {tcltest -verbose 'psb'} {unixOrPc} {
138 set result [slave msg test.tcl -verbose 'psb']
139 list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \
140 [regexp c-1.0 $msg] \
141 [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg]
144 test tcltest-2.5a {tcltest -verbose 'pass skip body'} {unixOrPc} {
145 set result [slave msg test.tcl -verbose "pass skip body"]
146 list $result [regexp "Contents of test case" $msg] [regexp a-1.0 $msg] \
147 [regexp c-1.0 $msg] \
148 [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg]
151 test tcltest-2.6 {tcltest -verbose 't'} {
152 -constraints {unixOrPc}
154 set result [slave msg test.tcl -verbose 't']
157 -result {^0 .*a-1.0 start.*b-1.0 start}
161 test tcltest-2.6a {tcltest -verbose 'start'} {
162 -constraints {unixOrPc}
164 set result [slave msg test.tcl -verbose start]
167 -result {^0 .*a-1.0 start.*b-1.0 start}
171 test tcltest-2.7 {tcltest::verbose} {
173 set oldVerbosity [verbose]
175 set currentVerbosity [verbose]
177 set newVerbosity [verbose]
178 verbose $oldVerbosity
179 list $currentVerbosity $newVerbosity
184 test tcltest-2.8 {tcltest -verbose 'error'} {
185 -constraints {unixOrPc}
187 set result [slave msg test.tcl -verbose error]
190 -result {errorInfo: foo.*errorCode: 9}
194 test tcltest-3.1 {tcltest -match 'a*'} {unixOrPc} {
195 set result [slave msg test.tcl -match a* -verbose 'ps']
196 list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
197 [regexp "Total.+4.+Passed.+1.+Skipped.+3.+Failed.+0" $msg]
199 test tcltest-3.2 {tcltest -match 'b*'} {unixOrPc} {
200 set result [slave msg test.tcl -match b* -verbose 'ps']
201 list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
202 [regexp "Total.+4.+Passed.+0.+Skipped.+3.+Failed.+1" $msg]
204 test tcltest-3.3 {tcltest -match 'c*'} {unixOrPc} {
205 set result [slave msg test.tcl -match c* -verbose 'ps']
206 list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
207 [regexp "Total.+4.+Passed.+0.+Skipped.+4.+Failed.+0" $msg]
209 test tcltest-3.4 {tcltest -match 'a* b*'} {unixOrPc} {
210 set result [slave msg test.tcl -match {a* b*} -verbose 'ps']
211 list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
212 [regexp "Total.+4.+Passed.+1.+Skipped.+2.+Failed.+1" $msg]
215 test tcltest-3.5 {tcltest::match} {
219 set currentMatch [match]
223 list $currentMatch $newMatch
229 test tcltest-4.1 {tcltest -skip 'a*'} {unixOrPc} {
230 set result [slave msg test.tcl -skip a* -verbose 'ps']
231 list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
232 [regexp "Total.+4.+Passed.+0.+Skipped.+2.+Failed.+1" $msg]
234 test tcltest-4.2 {tcltest -skip 'b*'} {unixOrPc} {
235 set result [slave msg test.tcl -skip b* -verbose 'ps']
236 list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
237 [regexp "Total.+4.+Passed.+1.+Skipped.+2.+Failed.+1" $msg]
239 test tcltest-4.3 {tcltest -skip 'c*'} {unixOrPc} {
240 set result [slave msg test.tcl -skip c* -verbose 'ps']
241 list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
242 [regexp "Total.+4.+Passed.+1.+Skipped.+1.+Failed.+2" $msg]
244 test tcltest-4.4 {tcltest -skip 'a* b*'} {unixOrPc} {
245 set result [slave msg test.tcl -skip {a* b*} -verbose 'ps']
246 list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
247 [regexp "Total.+4.+Passed.+0.+Skipped.+3.+Failed.+1" $msg]
249 test tcltest-4.5 {tcltest -match 'a* b*' -skip 'b*'} {unixOrPc} {
250 set result [slave msg test.tcl -match {a* b*} -skip b* -verbose 'ps']
251 list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
252 [regexp "Total.+4.+Passed.+1.+Skipped.+3.+Failed.+0" $msg]
255 test tcltest-4.6 {tcltest::skip} {
259 set currentSkip [skip]
263 list $currentSkip $newSkip
268 # -constraints, -limitconstraints, [testConstraint],
269 # $constraintsSpecified, [limitConstraints]
270 test tcltest-5.1 {tcltest -constraints 'knownBug'} {unixOrPc} {
271 set result [slave msg test.tcl -constraints knownBug -verbose 'ps']
272 list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
273 [regexp "Total.+4.+Passed.+2.+Skipped.+0.+Failed.+2" $msg]
275 test tcltest-5.2 {tcltest -constraints 'knownBug' -limitconstraints 1} {unixOrPc} {
276 set result [slave msg test.tcl -constraints knownBug -verbose 'p' -limitconstraints 1]
277 list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
278 [regexp "Total.+4.+Passed.+1.+Skipped.+3.+Failed.+0" $msg]
281 test tcltest-5.3 {testConstraint - constraint empty (tcltest::safeFetch)} {
283 set r1 [testConstraint tcltestFakeConstraint]
284 set r2 [testConstraint tcltestFakeConstraint 4]
285 set r3 [testConstraint tcltestFakeConstraint]
289 -cleanup {unset ::tcltest::testConstraints(tcltestFakeConstraint)}
292 # Removed this test of internals of tcltest. Those internals have changed.
293 #test tcltest-5.4 {tcltest::constraintsSpecified} {
295 # set constraintlist $::tcltest::constraintsSpecified
296 # set ::tcltest::constraintsSpecified {}
299 # set r1 $::tcltest::constraintsSpecified
300 # testConstraint tcltestFakeConstraint1 1
301 # set r2 $::tcltest::constraintsSpecified
302 # testConstraint tcltestFakeConstraint2 1
303 # set r3 $::tcltest::constraintsSpecified
306 # -result {{} tcltestFakeConstraint1 {tcltestFakeConstraint1 tcltestFakeConstraint2}}
308 # set ::tcltest::constraintsSpecified $constraintlist
309 # unset ::tcltest::testConstraints(tcltestFakeConstraint1)
310 # unset ::tcltest::testConstraints(tcltestFakeConstraint2)
314 test tcltest-5.5 {InitConstraints: list of built-in constraints} \
315 -constraints {!singleTestInterp} \
316 -setup {tcltest::InitConstraints} \
317 -body { lsort [array names ::tcltest::testConstraints] } \
319 95 98 asyncPipeClose eformat emptyTest exec hasIsoLocale interactive
320 knownBug mac macCrash macOnly macOrPc macOrUnix macOrWin nonBlockFiles
321 nonPortable notRoot nt pc pcCrash pcOnly root singleTestInterp socket
322 stdio tempNotMac tempNotPc tempNotUnix tempNotWin unix unixCrash unixExecs
323 unixOnly unixOrPc unixOrWin userInteraction win winCrash winOnly
326 # Removed this broken test. Its usage of [limitConstraints] was not
327 # in agreement with the documentation. [limitConstraints] is supposed
328 # to take an optional boolean argument, and "knownBug" ain't no boolean!
329 #test tcltest-5.6 {tcltest::limitConstraints} {
331 # set keeplc $::tcltest::limitConstraints
332 # set keepkb [testConstraint knownBug]
335 # set r1 [limitConstraints]
336 # set r2 [limitConstraints knownBug]
337 # set r3 [limitConstraints]
341 # limitConstraints $keeplc
342 # testConstraint knownBug $keepkb
344 # -result {false knownBug knownBug}
347 # -outfile, -errfile, [outputChannel], [outputFile], [errorChannel], [errorFile]
348 set printerror [makeFile {
349 package require tcltest
350 namespace import ::tcltest::*
351 puts [outputChannel] "a test"
352 ::tcltest::PrintError "a really short string"
353 ::tcltest::PrintError "a really really really really really really long \
354 string containing \"quotes\" and other bad bad stuff"
355 ::tcltest::PrintError "a really really long string containing a \
356 \"Path/that/is/really/long/and/contains/no/spaces\""
357 ::tcltest::PrintError "a really really long string containing a \
358 \"Really/Long/Path/that/contains/no/spaces/and/is/longer/than/eighty/characters/to/see/what/happens\""
359 ::tcltest::PrintError "Problem renaming file: error renaming \"Z:/ws/tcl8.2/win32-ix86/tests/core\" to \"Z:/ws/tcl8.2/win32-ix86/tests/movecore-core\""
363 test tcltest-6.1 {tcltest -outfile, -errfile defaults} {
364 -constraints unixOrPc
366 slave msg $printerror
369 -result {a test.*a really}
372 test tcltest-6.2 {tcltest -outfile a.tmp} {unixOrPc unixExecs} {
373 slave msg $printerror -outfile a.tmp
374 set result1 [catch {exec grep "a test" a.tmp}]
375 set result2 [catch {exec grep "a really" a.tmp}]
376 list [regexp "a test" $msg] [regexp "a really" $msg] \
377 $result1 $result2 [file exists a.tmp] [file delete a.tmp]
379 test tcltest-6.3 {tcltest -errfile a.tmp} {unixOrPc unixExecs} {
380 slave msg $printerror -errfile a.tmp
381 set result1 [catch {exec grep "a test" a.tmp}]
382 set result2 [catch {exec grep "a really" a.tmp}]
383 list [regexp "a test" $msg] [regexp "a really" $msg] \
384 $result1 $result2 [file exists a.tmp] [file delete a.tmp]
386 test tcltest-6.4 {tcltest -outfile a.tmp -errfile b.tmp} {unixOrPc unixExecs} {
387 slave msg $printerror -outfile a.tmp -errfile b.tmp
388 set result1 [catch {exec grep "a test" a.tmp}]
389 set result2 [catch {exec grep "a really" b.tmp}]
390 list [regexp "a test" $msg] [regexp "a really" $msg] \
392 [file exists a.tmp] [file delete a.tmp] \
393 [file exists b.tmp] [file delete b.tmp]
394 } {0 0 0 0 1 {} 1 {}}
396 test tcltest-6.5 {tcltest::errorChannel - retrieval} {
398 set of [errorChannel]
399 set ::tcltest::errorChannel stderr
406 set ::tcltest::errorChannel $of
410 test tcltest-6.6 {tcltest::errorFile (implicit errorChannel)} {
412 set ef [makeFile {} efile]
414 set ::tcltest::errorChannel stderr
415 set ::tcltest::errorFile stderr
418 set f0 [errorChannel]
420 set f2 [errorFile $ef]
421 set f3 [errorChannel]
423 subst {$f0;$f1;$f2;$f3;$f4}
425 -result {stderr;stderr;.*efile;file[0-9a-f]+;.*efile}
432 test tcltest-6.7 {tcltest::outputChannel - retrieval} {
434 set of [outputChannel]
435 set ::tcltest::outputChannel stdout
442 set tcltest::outputChannel $of
446 test tcltest-6.8 {tcltest::outputFile (implicit outputFile)} {
448 set ef [makeFile {} efile]
450 set ::tcltest::outputChannel stdout
451 set ::tcltest::outputFile stdout
454 set f0 [outputChannel]
456 set f2 [outputFile $ef]
457 set f3 [outputChannel]
459 subst {$f0;$f1;$f2;$f3;$f4}
461 -result {stdout;stdout;.*efile;file[0-9a-f]+;.*efile}
470 # Must use child processes to test -debug because it always writes
471 # messages to stdout, and we have no way to capture stdout of a
473 test tcltest-7.1 {tcltest test.tcl -debug 0} {unixOrPc} {
474 catch {exec [interpreter] test.tcl -debug 0} msg
475 regexp "Flags passed into tcltest" $msg
477 test tcltest-7.2 {tcltest test.tcl -debug 1} {unixOrPc} {
478 catch {exec [interpreter] test.tcl -debug 1 -skip b*} msg
479 list [regexp userSpecifiedSkip $msg] \
480 [regexp "Flags passed into tcltest" $msg]
482 test tcltest-7.3 {tcltest test.tcl -debug 1} {unixOrPc} {
483 catch {exec [interpreter] test.tcl -debug 1 -match b*} msg
484 list [regexp userSpecifiedNonMatch $msg] \
485 [regexp "Flags passed into tcltest" $msg]
487 test tcltest-7.4 {tcltest test.tcl -debug 2} {unixOrPc} {
488 catch {exec [interpreter] test.tcl -debug 2} msg
489 list [regexp "Flags passed into tcltest" $msg] [regexp "Running" $msg]
491 test tcltest-7.5 {tcltest test.tcl -debug 3} {unixOrPc} {
492 catch {exec [interpreter] test.tcl -debug 3} msg
493 list [regexp "Flags passed into tcltest" $msg] [regexp "Running" $msg]
496 test tcltest-7.6 {tcltest::debug} {
498 set old $::tcltest::debug
499 set ::tcltest::debug 0
507 list $f1 $f2 $f3 $f4 $f5
511 set ::tcltest::debug $old
519 package require tcltest
520 tcltest::makeFile {} a.tmp
521 puts [tcltest::outputChannel] "testdir: [tcltest::testsDirectory]"
525 set tdiaf [makeFile {} thisdirectoryisafile]
527 set normaldirectory [makeDirectory normaldirectory]
528 normalizePath normaldirectory
530 # -tmpdir, [temporaryDirectory]
531 test tcltest-8.1 {tcltest a.tcl -tmpdir a} {unixOrPc} {
532 file delete -force thisdirectorydoesnotexist
533 slave msg $a -tmpdir thisdirectorydoesnotexist
534 list [file exists [file join thisdirectorydoesnotexist a.tmp]] \
535 [file delete -force thisdirectorydoesnotexist]
537 test tcltest-8.2 {tcltest a.tcl -tmpdir thisdirectoryisafile} {
538 -constraints unixOrPc
540 slave msg $a -tmpdir $tdiaf
543 -result {*not a directory*}
547 # Test non-writeable directories, non-readable directories with directory flags
548 set notReadableDir [file join [temporaryDirectory] notreadable]
549 set notWriteableDir [file join [temporaryDirectory] notwriteable]
551 makeDirectory notreadable
552 makeDirectory notwriteable
554 switch $tcl_platform(platform) {
556 file attributes $notReadableDir -permissions 00333
557 file attributes $notWriteableDir -permissions 00555
560 catch {file attributes $notWriteableDir -readonly 1}
561 catch {testchmod 000 $notWriteableDir}
565 test tcltest-8.3 {tcltest a.tcl -tmpdir notReadableDir} {unix notRoot} {
566 slave msg $a -tmpdir $notReadableDir
567 string match {*not readable*} $msg
570 test tcltest-8.4 {tcltest a.tcl -tmpdir notWriteableDir} {unixOrPc notRoot} {
571 slave msg $a -tmpdir $notWriteableDir
572 string match {*not writeable*} $msg
575 test tcltest-8.5 {tcltest a.tcl -tmpdir normaldirectory} {unixOrPc} {
576 slave msg $a -tmpdir $normaldirectory
577 # The join is necessary because the message can be split on multiple lines
578 list [file exists [file join $normaldirectory a.tmp]] \
579 [file delete [file join $normaldirectory a.tmp]]
581 cd [workingDirectory]
583 test tcltest-8.6 {temporaryDirectory} {
585 set old $::tcltest::temporaryDirectory
586 set ::tcltest::temporaryDirectory $normaldirectory
589 set f1 [temporaryDirectory]
590 set f2 [temporaryDirectory [workingDirectory]]
591 set f3 [temporaryDirectory]
594 -result "[list $normaldirectory [workingDirectory] [workingDirectory]]"
596 set ::tcltest::temporaryDirectory $old
600 test tcltest-8.6a {temporaryDirectory - test format 2} -setup {
601 set old $::tcltest::temporaryDirectory
602 set ::tcltest::temporaryDirectory $normaldirectory
604 set f1 [temporaryDirectory]
605 set f2 [temporaryDirectory [workingDirectory]]
606 set f3 [temporaryDirectory]
609 set ::tcltest::temporaryDirectory $old
610 } -result [list $normaldirectory [workingDirectory] [workingDirectory]]
612 cd [temporaryDirectory]
613 # -testdir, [testsDirectory]
614 test tcltest-8.10 {tcltest a.tcl -testdir thisdirectorydoesnotexist} {unixOrPc} {
615 file delete -force thisdirectorydoesnotexist
616 slave msg $a -testdir thisdirectorydoesnotexist
617 string match "*does not exist*" $msg
620 test tcltest-8.11 {tcltest a.tcl -testdir thisdirectoryisafile} {unixOrPc} {
621 slave msg $a -testdir $tdiaf
622 string match "*not a directory*" $msg
625 test tcltest-8.12 {tcltest a.tcl -testdir notReadableDir} {unix notRoot} {
626 slave msg $a -testdir $notReadableDir
627 string match {*not readable*} $msg
631 test tcltest-8.13 {tcltest a.tcl -testdir normaldirectory} {unixOrPc} {
632 slave msg $a -testdir $normaldirectory
633 # The join is necessary because the message can be split on multiple lines
634 list [string first "testdir: $normaldirectory" [join $msg]] \
635 [file exists [file join [temporaryDirectory] a.tmp]] \
636 [file delete [file join [temporaryDirectory] a.tmp]]
638 cd [workingDirectory]
641 test tcltest-8.14 {testsDirectory} {
643 set old $::tcltest::testsDirectory
644 set ::tcltest::testsDirectory $normaldirectory
647 set f1 [testsDirectory]
648 set f2 [testsDirectory $current]
649 set f3 [testsDirectory]
652 -result "[list $normaldirectory $current $current]"
654 set ::tcltest::testsDirectory $old
659 test tcltest-8.60 {::workingDirectory} {
661 set old $::tcltest::workingDirectory
663 set ::tcltest::workingDirectory $normaldirectory
667 set f1 [workingDirectory]
669 set f3 [workingDirectory $current]
671 set f5 [workingDirectory]
672 list $f1 $f2 $f3 $f4 $f5
674 -result "[list $normaldirectory \
680 set ::tcltest::workingDirectory $old
685 # clean up from directory testing
687 switch $tcl_platform(platform) {
689 file attributes $notReadableDir -permissions 777
690 file attributes $notWriteableDir -permissions 777
693 catch {file attributes $notWriteableDir -readonly 0}
697 file delete -force $notReadableDir $notWriteableDir
699 removeFile thisdirectoryisafile
700 removeDirectory normaldirectory
702 # -file, -notfile, [matchFiles], [skipFiles]
703 test tcltest-9.1 {-file d*.tcl} -constraints {unixOrPc} -setup {
704 set old [testsDirectory]
705 testsDirectory [file dirname [info script]]
707 slave msg [file join [testsDirectory] all.tcl] -file d*.test
711 } -match regexp -result {dstring\.test}
713 test tcltest-9.2 {-file d*.tcl} -constraints {unixOrPc} -setup {
714 set old [testsDirectory]
715 testsDirectory [file dirname [info script]]
717 slave msg [file join [testsDirectory] all.tcl] \
718 -file d*.test -notfile dstring*
719 regexp {dstring\.test} $msg
724 test tcltest-9.3 {matchFiles} {
728 set current [matchFiles]
737 test tcltest-9.4 {skipFiles} {
741 set current [skipFiles]
750 test tcltest-9.5 {GetMatchingFiles: Bug 1119798} -setup {
751 set d [makeDirectory tmp]
754 file copy [file join [file dirname [info script]] all.tcl] $d
756 slave msg [file join [temporaryDirectory] all.tcl] -file f*
757 regexp {exiting with errors:} $msg
759 file delete [file join $d all.tcl]
761 removeDirectory foo $d
765 # -preservecore, [preserveCore]
767 package require tcltest
768 namespace import ::tcltest::test
769 test makecore {make a core file} {
773 ::tcltest::cleanupTests
777 cd [temporaryDirectory]
778 test tcltest-10.1 {-preservecore 0} {unixOrPc} {
779 slave msg $mc -preservecore 0
781 regexp "Core file produced" $msg
783 test tcltest-10.2 {-preservecore 1} {unixOrPc} {
784 slave msg $mc -preservecore 1
786 regexp "Core file produced" $msg
788 test tcltest-10.3 {-preservecore 2} {unixOrPc} {
789 slave msg $mc -preservecore 2
791 list [regexp "Core file produced" $msg] [regexp "Moving file to" $msg] \
792 [regexp "core-" $msg] [file delete core-makecore]
794 test tcltest-10.4 {-preservecore 3} {unixOrPc} {
795 slave msg $mc -preservecore 3
797 list [regexp "Core file produced" $msg] [regexp "Moving file to" $msg] \
798 [regexp "core-" $msg] [file delete core-makecore]
801 # Removing this test. It makes no sense to test the ability of
802 # [preserveCore] to accept an invalid value that will cause errors
803 # in other parts of tcltest's operation.
804 #test tcltest-10.5 {preserveCore} {
806 # set old [preserveCore]
807 # set result [preserveCore foo]
808 # set result2 [preserveCore]
810 # list $result $result2
814 removeFile makecore.tcl
816 # -load, -loadfile, [loadScript], [loadFile]
818 package require tcltest
819 namespace import tcltest::*
820 puts [outputChannel] $::tcltest::loadScript
823 set loadfile [makeFile $contents load.tcl]
825 test tcltest-12.1 {-load xxx} {unixOrPc} {
826 slave msg $loadfile -load xxx
830 # Using child process because of -debug usage.
831 test tcltest-12.2 {-loadfile load.tcl} {unixOrPc} {
832 catch {exec [interpreter] $loadfile -debug 2 -loadfile $loadfile} msg
834 [regexp {tcltest} [join [list $msg] [split $msg \n]]] \
835 [regexp {loadScript} [join [list $msg] [split $msg \n]]]
838 test tcltest-12.3 {loadScript} {
840 set old $::tcltest::loadScript
841 set ::tcltest::loadScript {}
845 set f2 [loadScript xxx]
851 set ::tcltest::loadScript $old
855 test tcltest-12.4 {loadFile} {
857 set olds $::tcltest::loadScript
858 set ::tcltest::loadScript {}
859 set oldf $::tcltest::loadFile
860 set ::tcltest::loadFile {}
865 set f3 [loadFile $loadfile]
868 list $f1 $f2 $f3 $f4 $f5
870 -result "[list {} {} $loadfile $contents $loadfile]\n"
872 set ::tcltest::loadScript $olds
873 set ::tcltest::loadFile $oldf
879 test tcltest-13.1 {interpreter} {
881 set old $::tcltest::tcltest
882 set ::tcltest::tcltest tcltest
886 set f2 [interpreter tclsh]
890 -result {tcltest tclsh tclsh}
892 set ::tcltest::tcltest $old
896 # -singleproc, [singleProcess]
897 set spd [makeDirectory singleprocdir]
906 set allfile [makeFile {
907 package require tcltest
908 namespace import tcltest::*
909 testsDirectory [file join [temporaryDirectory] singleprocdir]
911 } all-single.tcl $spd]
912 cd [workingDirectory]
914 test tcltest-14.1 {-singleproc - single process} {
915 -constraints {unixOrPc}
917 slave msg $allfile -singleproc 0 -tmpdir [temporaryDirectory]
920 -result {Test file error: can't unset .foo.: no such variable}
924 test tcltest-14.2 {-singleproc - multiple process} {
925 -constraints {unixOrPc}
927 slave msg $allfile -singleproc 1 -tmpdir [temporaryDirectory]
930 -result {single1.test.*single2.test.*all\-single.tcl:.*Total.*0.*Passed.*0.*Skipped.*0.*Failed.*0}
934 test tcltest-14.3 {singleProcess} {
936 set old $::tcltest::singleProcess
937 set ::tcltest::singleProcess 0
940 set f1 [singleProcess]
941 set f2 [singleProcess 1]
942 set f3 [singleProcess]
947 set ::tcltest::singleProcess $old
950 removeFile single1.test $spd
951 removeFile single2.test $spd
952 removeDirectory singleprocdir
954 # -asidefromdir, -relateddir, [matchDirectories], [skipDirectories]
956 # Before running these tests, need to set up test subdirectories with their own
959 set dtd [makeDirectory dirtestdir]
960 set dtd1 [makeDirectory dirtestdir2.1 $dtd]
961 set dtd2 [makeDirectory dirtestdir2.2 $dtd]
962 set dtd3 [makeDirectory dirtestdir2.3 $dtd]
964 package require tcltest
965 namespace import -force tcltest::*
966 testsDirectory [file join [temporaryDirectory] dirtestdir]
970 package require tcltest
971 namespace import -force tcltest::*
972 testsDirectory [file join [temporaryDirectory] dirtestdir dirtestdir2.1]
976 package require tcltest
977 namespace import -force tcltest::*
978 testsDirectory [file join [temporaryDirectory] dirtestdir dirtestdir2.2]
982 package require tcltest
983 namespace import -force tcltest::*
984 testsDirectory [file join [temporaryDirectory] dirtestdir dirtestdir2.3]
988 test tcltest-15.1 {basic directory walking} {
989 -constraints {unixOrPc}
992 [file join $dtd all.tcl] \
993 -tmpdir [temporaryDirectory]] == 1} {
999 -result {Tests located in:.*dirtestdir.*Tests located in:.*dirtestdir2.[123].*Tests located in:.*dirtestdir2.[123].*Tests located in:.*dirtestdir2.[123]}
1002 test tcltest-15.2 {-asidefromdir} {
1003 -constraints {unixOrPc}
1006 [file join $dtd all.tcl] \
1007 -asidefromdir dirtestdir2.3 \
1008 -tmpdir [temporaryDirectory]] == 1} {
1014 -result {Tests located in:.*dirtestdir.*Tests located in:.*dirtestdir2.[12].*Tests located in:.*dirtestdir2.[12].*dirtestdir2.[12] test ended at .*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1015 Error: No test files remain after applying your match and skip patterns!
1016 Error: No test files remain after applying your match and skip patterns!
1017 Error: No test files remain after applying your match and skip patterns!$}
1020 test tcltest-15.3 {-relateddir, non-existent dir} {
1021 -constraints {unixOrPc}
1024 [file join $dtd all.tcl] \
1025 -relateddir [file join [temporaryDirectory] dirtestdir0] \
1026 -tmpdir [temporaryDirectory]] == 1} {
1032 -result {[^~]|dirtestdir[^2]}
1035 test tcltest-15.4 {-relateddir, subdir} {
1036 -constraints {unixOrPc}
1039 [file join $dtd all.tcl] \
1040 -relateddir dirtestdir2.1 -tmpdir [temporaryDirectory]] == 1} {
1046 -result {Tests located in:.*dirtestdir2.[^23]}
1048 test tcltest-15.5 {-relateddir, -asidefromdir} {
1049 -constraints {unixOrPc}
1052 [file join $dtd all.tcl] \
1053 -relateddir "dirtestdir2.1 dirtestdir2.2" \
1054 -asidefromdir dirtestdir2.2 \
1055 -tmpdir [temporaryDirectory]] == 1} {
1061 -result {Tests located in:.*dirtestdir2.[^23]}
1064 test tcltest-15.6 {matchDirectories} {
1066 set old [matchDirectories]
1067 set ::tcltest::matchDirectories {}
1070 set r1 [matchDirectories]
1071 set r2 [matchDirectories foo]
1072 set r3 [matchDirectories]
1076 set ::tcltest::matchDirectories $old
1078 -result {{} foo foo}
1081 test tcltest-15.7 {skipDirectories} {
1083 set old [skipDirectories]
1084 set ::tcltest::skipDirectories {}
1087 set r1 [skipDirectories]
1088 set r2 [skipDirectories foo]
1089 set r3 [skipDirectories]
1093 set ::tcltest::skipDirectories $old
1095 -result {{} foo foo}
1097 removeDirectory dirtestdir2.3 $dtd
1098 removeDirectory dirtestdir2.2 $dtd
1099 removeDirectory dirtestdir2.1 $dtd
1100 removeDirectory dirtestdir
1103 test tcltest-19.1 {TCLTEST_OPTIONS default} -setup {
1104 if {[info exists ::env(TCLTEST_OPTIONS)]} {
1105 set oldoptions $::env(TCLTEST_OPTIONS)
1109 # set this to { } instead of just {} to get around quirk in
1110 # Windows env handling that removes empty elements from env array.
1111 set ::env(TCLTEST_OPTIONS) { }
1112 interp create slave1
1113 slave1 eval [list set argv {-debug 2}]
1114 slave1 alias puts puts
1115 interp create slave2
1116 slave2 alias puts puts
1118 interp delete slave2
1119 interp delete slave1
1120 if {$oldoptions == "none"} {
1121 unset ::env(TCLTEST_OPTIONS)
1123 set ::env(TCLTEST_OPTIONS) $oldoptions
1126 slave1 eval [package ifneeded tcltest [package provide tcltest]]
1127 slave1 eval tcltest::debug
1128 set ::env(TCLTEST_OPTIONS) "-debug 3"
1129 slave2 eval [package ifneeded tcltest [package provide tcltest]]
1130 slave2 eval tcltest::debug
1131 } -result {^3$} -match regexp -output\
1132 {tcltest::debug\s+= 2.*tcltest::debug\s+= 3}
1134 # Begin testing of tcltest procs ...
1136 cd [temporaryDirectory]
1138 test tcltest-20.1 {PrintError} {unixOrPc} {
1139 set result [slave msg $printerror]
1140 list $result [regexp "Error: a really short string" $msg] \
1141 [regexp " \"quotes\"" $msg] [regexp " \"Path" $msg] \
1142 [regexp " \"Really" $msg] [regexp Problem $msg]
1144 cd [workingDirectory]
1145 removeFile printerror.tcl
1148 test tcltest-21.0 {name and desc but no args specified} -setup {
1154 test tcltest-21.0.0 bar
1157 test tcltest-21.1 {expect with glob} {
1162 -result {[ab] b c d e}
1165 test tcltest-21.2 {force a test command failure} {
1167 test tcltest-21.2.0 {
1172 -result {bad option "1": must be -body, -cleanup, -constraints, -errorOutput, -match, -output, -result, -returnCodes, or -setup}
1175 test tcltest-21.3 {test command with setup} {
1182 -cleanup {unset foo}
1186 test tcltest-21.4 {test command with cleanup failure} {
1188 if {[info exists foo]} {
1191 set fail $::tcltest::currentFailure
1196 test tcltest-21.4.0 {foo-1} {
1197 -cleanup {unset foo}
1202 -cleanup {verbose $v; set ::tcltest::currentFailure $fail}
1203 -output "Test cleanup failed:.*can't unset \"foo\": no such variable"
1206 test tcltest-21.5 {test command with setup failure} {
1208 if {[info exists foo]} {
1211 set fail $::tcltest::currentFailure
1214 test tcltest-21.5.0 {foo-2} {
1220 -cleanup {set ::tcltest::currentFailure $fail}
1221 -output "Test setup failed:.*can't unset \"foo\": no such variable"
1224 test tcltest-21.6 {test command - setup occurs before cleanup & before script} {
1225 -setup {set v [verbose]; set fail $::tcltest::currentFailure}
1228 test tcltest-21.6.0 {foo-3} {
1230 if {[info exists foo]} {
1242 puts [outputChannel] "foo is wrong"
1244 puts [outputChannel] "foo is 2"
1250 -cleanup {verbose $v; set ::tcltest::currentFailure $fail}
1256 test tcltest-21.7 {test command - bad flag} {
1257 -setup {set fail $::tcltest::currentFailure}
1258 -cleanup {set ::tcltest::currentFailure $fail}
1260 test tcltest-21.7.0 {foo-4} {
1265 -result {bad option "-foobar": must be -body, -cleanup, -constraints, -errorOutput, -match, -output, -result, -returnCodes, or -setup}
1268 # alternate test command format (these are the same as 21.1-21.6, with the
1269 # exception of being in the all-inline format)
1271 test tcltest-21.7a {expect with glob} \
1272 -body {list a b c d e} \
1273 -result {[ab] b c d e} \
1276 test tcltest-21.8 {force a test command failure} \
1277 -setup {set fail $::tcltest::currentFailure} \
1279 test tcltest-21.8.0 {
1284 -cleanup {set ::tcltest::currentFailure $fail} \
1285 -result {bad option "1": must be -body, -cleanup, -constraints, -errorOutput, -match, -output, -result, -returnCodes, or -setup}
1287 test tcltest-21.9 {test command with setup} \
1288 -setup {set foo 1} \
1290 -cleanup {unset foo} \
1293 test tcltest-21.10 {test command with cleanup failure} -setup {
1294 if {[info exists foo]} {
1297 set fail $::tcltest::currentFailure
1301 set ::tcltest::currentFailure $fail
1304 test tcltest-21.10.0 {foo-1} -cleanup {unset foo}
1305 } -result {^$} -match regexp \
1306 -output {Test cleanup failed:.*can't unset \"foo\": no such variable}
1308 test tcltest-21.11 {test command with setup failure} -setup {
1309 if {[info exists foo]} {
1312 set fail $::tcltest::currentFailure
1313 } -cleanup {set ::tcltest::currentFailure $fail} -body {
1314 test tcltest-21.11.0 {foo-2} -setup {unset foo}
1315 } -result {^$} -output {Test setup failed:.*can't unset \"foo\": no such variable} -match regexp
1317 test tcltest-21.12 {
1318 test command - setup occurs before cleanup & before script
1320 set fail $::tcltest::currentFailure
1324 set ::tcltest::currentFailure $fail
1327 test tcltest-21.12.0 {foo-3} -setup {
1328 if {[info exists foo]} {
1338 puts [outputChannel] "foo is wrong"
1340 puts [outputChannel] "foo is 2"
1342 } -result {$expected}
1343 } -result {^$} -output {foo is 2} -match regexp
1345 # test all.tcl usage (runAllTests); simulate .test file failure, as well as
1346 # crashes to determine whether or not these errors are logged.
1348 set atd [makeDirectory alltestdir]
1350 package require tcltest
1351 namespace import -force tcltest::*
1352 testsDirectory [file join [temporaryDirectory] alltestdir]
1359 error "throw an error"
1362 package require tcltest
1363 namespace import -force tcltest::*
1364 test foo-1.1 {foo} {
1371 # Must use a child process because stdout/stderr parsing can't be
1372 # duplicated in slave interp.
1373 test tcltest-22.1 {runAllTests} {
1374 -constraints {unixOrPc}
1376 exec [interpreter] \
1377 [file join $atd all.tcl] \
1378 -verbose t -tmpdir [temporaryDirectory]
1381 -result "Test files exiting with errors:.*error.test.*exit.test"
1383 removeDirectory alltestdir
1385 # makeFile, removeFile, makeDirectory, removeDirectory, viewFile
1386 test tcltest-23.1 {makeFile} {
1388 set mfdir [file join [temporaryDirectory] mfdir]
1393 makeFile {} et1.tmp $mfdir
1394 list [file exists [file join [temporaryDirectory] t1.tmp]] \
1395 [file exists [file join $mfdir et1.tmp]]
1398 file delete -force $mfdir \
1399 [file join [temporaryDirectory] t1.tmp]
1403 test tcltest-23.2 {removeFile} {
1405 set mfdir [file join [temporaryDirectory] mfdir]
1408 makeFile {} et1.tmp $mfdir
1409 if {![file exists [file join [temporaryDirectory] t1.tmp]] || \
1410 ![file exists [file join $mfdir et1.tmp]]} {
1411 error "file creation didn't work"
1416 removeFile et1.tmp $mfdir
1417 list [file exists [file join [temporaryDirectory] t1.tmp]] \
1418 [file exists [file join $mfdir et1.tmp]]
1421 file delete -force $mfdir \
1422 [file join [temporaryDirectory] t1.tmp]
1426 test tcltest-23.3 {makeDirectory} {
1428 set mfdir [file join [temporaryDirectory] mfdir]
1431 makeDirectory d2 $mfdir
1432 list [file exists [file join [temporaryDirectory] d1]] \
1433 [file exists [file join $mfdir d2]]
1436 file delete -force [file join [temporaryDirectory] d1] $mfdir
1440 test tcltest-23.4 {removeDirectory} {
1442 set mfdir [makeDirectory mfdir]
1444 makeDirectory t2 $mfdir
1445 if {![file exists $mfdir] || \
1446 ![file exists [file join [temporaryDirectory] $mfdir t2]]} {
1447 error "setup failed - directory not created"
1452 removeDirectory t2 $mfdir
1453 list [file exists [file join [temporaryDirectory] t1]] \
1454 [file exists [file join $mfdir t2]]
1458 test tcltest-23.5 {viewFile} {
1460 set mfdir [file join [temporaryDirectory] mfdir]
1462 makeFile {foobar} t1.tmp
1463 makeFile {foobarbaz} t2.tmp $mfdir
1464 list [viewFile t1.tmp] [viewFile t2.tmp $mfdir]
1466 -result {foobar foobarbaz}
1468 file delete -force $mfdir
1474 proc matchNegative { expected actual } {
1476 foreach a $actual e $expected {
1488 list [catch {customMatch} result] $result
1489 } -result [list 1 "wrong # args: should be \"customMatch mode script\""]
1494 list [catch {customMatch foo} result] $result
1495 } -result [list 1 "wrong # args: should be \"customMatch mode script\""]
1500 list [catch {customMatch foo bar baz} result] $result
1501 } -result [list 1 "wrong # args: should be \"customMatch mode script\""]
1504 customMatch: argument checking
1506 list [catch {customMatch bad "a \{ b"} result] $result
1507 } -result [list 1 "invalid customMatch script; can't evaluate after completion"]
1510 test: valid -match values
1513 test tcltest-24.4.0 {} \
1514 -match [namespace current]::noSuchMode
1516 } -match glob -result {1 *bad -match value*}
1519 test: valid -match values
1521 customMatch [namespace current]::alwaysMatch "format 1 ;#"
1524 test tcltest-24.5.0 {} \
1525 -match [namespace current]::noSuchMode
1527 } -match glob -result {1 *bad -match value*: must be *alwaysMatch,*}
1530 customMatch: -match script that always matches
1532 customMatch [namespace current]::alwaysMatch "format 1 ;#"
1536 test tcltest-24.6.0 {} -match [namespace current]::alwaysMatch \
1537 -body {format 1} -result 0
1540 } -result {} -output {} -errorOutput {}
1543 customMatch: replace default -exact matching
1545 set saveExactMatchScript $::tcltest::CustomMatch(exact)
1546 customMatch exact "format 1 ;#"
1550 test tcltest-24.7.0 {} -body {format 1} -result 0
1553 customMatch exact $saveExactMatchScript
1554 unset saveExactMatchScript
1555 } -result {} -output {}
1558 customMatch: error during match
1560 proc errorDuringMatch args {return -code error "match returned error"}
1561 customMatch [namespace current]::errorDuringMatch \
1562 [namespace code errorDuringMatch]
1564 set fail $::tcltest::currentFailure
1567 test tcltest-24.9.0 {} -match [namespace current]::errorDuringMatch
1570 set ::tcltest::currentFailure $fail
1571 } -match glob -result {} -output {*FAILED*match returned error*}
1573 test tcltest-24.10 {
1574 customMatch: bad return from match command
1576 proc nonBooleanReturn args {return foo}
1577 customMatch nonBooleanReturn [namespace code nonBooleanReturn]
1579 set fail $::tcltest::currentFailure
1582 test tcltest-24.10.0 {} -match nonBooleanReturn
1585 set ::tcltest::currentFailure $fail
1586 } -match glob -result {} -output {*FAILED*expected boolean value*}
1588 test tcltest-24.11 {
1592 } -match exact -result {A B C}
1594 test tcltest-24.12 {
1595 test: -match exact match command eval in ::, not caller namespace
1597 set saveExactMatchScript $::tcltest::CustomMatch(exact)
1598 customMatch exact [list string equal]
1600 proc string args {error {called [string] in caller namespace}}
1603 test tcltest-24.12.0 {} -body {format 1} -result 1
1607 customMatch exact $saveExactMatchScript
1608 unset saveExactMatchScript
1609 } -match exact -result {} -output {}
1611 test tcltest-24.13 {
1612 test: -match exact failure
1614 set saveExactMatchScript $::tcltest::CustomMatch(exact)
1615 customMatch exact [list string equal]
1617 set fail $::tcltest::currentFailure
1620 test tcltest-24.13.0 {} -body {format 1} -result 0
1622 set ::tcltest::currentFailure $fail
1624 customMatch exact $saveExactMatchScript
1625 unset saveExactMatchScript
1626 } -match glob -result {} -output {*FAILED*Result was:
1630 test tcltest-24.14 {
1634 } -match glob -result {A B*}
1636 test tcltest-24.15 {
1637 test: -match glob failure
1640 set fail $::tcltest::currentFailure
1643 test tcltest-24.15.0 {} -match glob -body {format {A B C}} \
1646 set ::tcltest::currentFailure $fail
1648 } -match glob -result {} -output {*FAILED*Result was:
1652 test tcltest-24.16 {
1656 } -match regexp -result {A B.*}
1658 test tcltest-24.17 {
1659 test: -match regexp failure
1661 set fail $::tcltest::currentFailure
1665 test tcltest-24.17.0 {} -match regexp -body {format {A B C}} \
1668 set ::tcltest::currentFailure $fail
1670 } -match glob -result {} -output {*FAILED*Result was:
1674 test tcltest-24.18 {
1675 test: -match custom forget namespace qualification
1677 set fail $::tcltest::currentFailure
1679 customMatch negative matchNegative
1682 test tcltest-24.18.0 {} -match negative -body {format {A B C}} \
1685 set ::tcltest::currentFailure $fail
1687 } -match glob -result {} -output {*FAILED*Error testing result:*}
1689 test tcltest-24.19 {
1693 customMatch negative [namespace code matchNegative]
1696 test tcltest-24.19.0 {} -match negative -body {format {A B C}} \
1700 } -match exact -result {} -output {}
1702 test tcltest-24.20 {
1703 test: -match custom failure
1705 set fail $::tcltest::currentFailure
1707 customMatch negative [namespace code matchNegative]
1710 test tcltest-24.20.0 {} -match negative -body {format {A B C}} \
1713 set ::tcltest::currentFailure $fail
1715 } -match glob -result {} -output {*FAILED*Result was:
1716 *(negative matching):
1720 constraint of setup/cleanup (Bug 589859)
1724 # Buggy tcltest will generate result of 2
1725 test tcltest-25.1.0 {} -constraints knownBug -setup {
1731 } -match glob -result *
1738 puts -nonewline (Bug 612786)
1740 puts -nonewline stdout bla
1741 puts -nonewline stdout bla
1745 reported return code (Bug 611922)
1747 set fail $::tcltest::currentFailure
1751 test tcltest-25.3.0 {} -body {
1755 set ::tcltest::currentFailure $fail
1757 } -match glob -output {*generated error; Return code was: 1*}
1759 test tcltest-26.1 {Bug/RFE 1017151} -setup {
1761 package require tcltest
1762 set errorInfo "Should never see this"
1763 tcltest::test tcltest-26.1.0 {
1764 no errorInfo when only return code mismatch
1767 } -returnCodes error -result 1
1768 tcltest::cleanupTests
1771 slave msg [file join [temporaryDirectory] test.tcl]
1775 } -match glob -result {*
1776 ---- Return code should have been one of: 1
1777 ==== tcltest-26.1.0 FAILED*}
1779 test tcltest-26.2 {Bug/RFE 1017151} -setup {
1781 package require tcltest
1782 set errorInfo "Should never see this"
1783 tcltest::test tcltest-26.2.0 {do not mask body errorInfo} -body {
1786 error "cleanup error"
1788 tcltest::cleanupTests
1791 slave msg [file join [temporaryDirectory] test.tcl]
1795 } -match glob -result {*
1796 ---- errorInfo: body error
1798 ---- errorInfo(cleanup): cleanup error*}
1803 namespace delete ::tcltest::test