summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2011-03-10 13:40:43 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2011-03-10 13:40:43 (GMT)
commitfeb40ba8d2f3784d9284d9f86d2e7ef45342107b (patch)
treeb8ab87dfa2594a0dc0488ae4f4d888a9f61cf883 /library
parent56053d42643a128b68bddd9b6a830193c4f2b58f (diff)
downloadtcl-feb40ba8d2f3784d9284d9f86d2e7ef45342107b.zip
tcl-feb40ba8d2f3784d9284d9f86d2e7ef45342107b.tar.gz
tcl-feb40ba8d2f3784d9284d9f86d2e7ef45342107b.tar.bz2
Make tests in child interpreters report their summary info in the master.
Bumped tcltest version to 2.3.3
Diffstat (limited to 'library')
-rw-r--r--library/tcltest/pkgIndex.tcl2
-rw-r--r--library/tcltest/tcltest.tcl33
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