diff options
author | dkf <dkf@noemail.net> | 2011-03-10 13:40:43 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2011-03-10 13:40:43 (GMT) |
commit | 197a86343e337d3722c0ac2284f61f77f000f5ed (patch) | |
tree | b8ab87dfa2594a0dc0488ae4f4d888a9f61cf883 /library | |
parent | 6e96455cbb30c6c8811a0ff346039ed8cda3b6a9 (diff) | |
download | tcl-197a86343e337d3722c0ac2284f61f77f000f5ed.zip tcl-197a86343e337d3722c0ac2284f61f77f000f5ed.tar.gz tcl-197a86343e337d3722c0ac2284f61f77f000f5ed.tar.bz2 |
Make tests in child interpreters report their summary info in the master.
Bumped tcltest version to 2.3.3
FossilOrigin-Name: 6560e5320516863d0e4898a2033691c97a1396fe
Diffstat (limited to 'library')
-rw-r--r-- | library/tcltest/pkgIndex.tcl | 2 | ||||
-rw-r--r-- | library/tcltest/tcltest.tcl | 33 |
2 files changed, 33 insertions, 2 deletions
diff --git a/library/tcltest/pkgIndex.tcl b/library/tcltest/pkgIndex.tcl index fe80272..2eb43a6 100644 --- a/library/tcltest/pkgIndex.tcl +++ b/library/tcltest/pkgIndex.tcl @@ -9,4 +9,4 @@ # full path name of this file's directory. if {![package vsatisfies [package provide Tcl] 8.5]} {return} -package ifneeded tcltest 2.3.2 [list source [file join $dir tcltest.tcl]] +package ifneeded tcltest 2.3.3 [list source [file join $dir tcltest.tcl]] diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl index 15b7293..ad61f9c 100644 --- a/library/tcltest/tcltest.tcl +++ b/library/tcltest/tcltest.tcl @@ -22,7 +22,7 @@ namespace eval tcltest { # When the version number changes, be sure to update the pkgIndex.tcl file, # and the install directory in the Makefiles. When the minor version # changes (new feature) be sure to update the man page as well. - variable Version 2.3.2 + variable Version 2.3.3 # Compatibility support for dumb variables defined in tcltest 1 # Do not use these. Call [package provide Tcl] and [info patchlevel] @@ -795,6 +795,29 @@ namespace eval tcltest { trace variable Option(-errfile) w \ [namespace code {errorChannel $Option(-errfile) ;#}] + proc loadIntoSlaveInterpreter {slave args} { + variable Version + interp eval $slave [list set ::argv $args] + interp eval $slave [list package require tcltest $Version] + interp alias $slave ::tcltest::ReportToMaster \ + {} ::tcltest::ReportedFromSlave + } + proc ReportedFromSlave {total passed skipped failed because newfiles} { + variable numTests + variable skippedBecause + variable createdNewFiles + incr numTests(Total) $total + incr numTests(Passed) $passed + incr numTests(Skipped) $skipped + incr numTests(Failed) $failed + foreach {constraint count} $because { + incr skippedBecause($constraint) $count + } + foreach {testfile created} $newfiles { + lappend createdNewFiles($testfile) {*}$created + } + return + } } ##################################################################### @@ -2354,6 +2377,14 @@ proc tcltest::cleanupTests {{calledFromAllFile 0}} { FillFilesExisted set testFileName [file tail [info script]] + # Hook to handle reporting to a parent interpreter + if {[llength [info commands [namespace current]::ReportToMaster]]} { + ReportToMaster $numTests(Total) $numTests(Passed) $numTests(Skipped) \ + $numTests(Failed) [array get skippedBecause] \ + [array get createdNewFiles] + set testSingleFile false + } + # Call the cleanup hook cleanupTestsHook |