|
||||||
SUMMARY: CHILDREN | PARAMETER | INSTPROC | INSTFILTER | INSTFORWARD | DETAIL: | INSTPROC |
::xotcl::Object | +--::xox::Node | +--::xounit::Test | +--::xounit::Assert | +--::xounit::TestCase | +--::xounit::Application
RunCoverage is an application that reports the unit testing coverage for all methods in all classes in a set of packages.
Variables | |||
Name | Default Value | Class | Comment |
currentTestMethod |
::xounit::TestCase | name of the currently running test method. |
|
formatterClass |
::xounit::TestResultsTextFormatter | ::xounit::Application | test results formatter used to display results of application |
name |
Application | ::xounit::Application | the name of the Application |
nodeName |
::xox::Node | ||
packages |
::xounit::RunCoverage | the packages to report |
|
result |
::xounit::TestCase | the result for the current run. |
|
results |
"" | ::xounit::Application | failures, errors, and passes from Application execution |
Methods | |
Name | Comment |
init {args}
| Initialize and run the application using packages supplied by the command line |
runTestApplication {}
| The main method of the application |
Methods from ::xounit::Application |
printResults, runApplication, runApplicationAndReport,
|
Methods from ::xotcl::Object |
#, ., ?, ?code, ?methods, ?object, abstract, copy, coverageFilter, defaultmethod, extractConfigureArg, filterappend, garbageCollect, get#, getClean#, hasclass, init, methodTag, mixinappend, move, profileFilter, self, setParameterDefaults, shell, tclcmd, traceFilter,
|
Instproc Detail |
Initialize and run the application using packages supplied by the command line.
args
::xounit::RunCoverage instproc init {args} { my set packages $args my runApplication runTestApplication }
The main method of the application. Loads packages. Adds classes to watch list and enables coverageFilter. Runs unit tests. Creates CoverageReport and reports the coverage by the unit tests.
::xounit::RunCoverage instproc runTestApplication {} { my instvar packages set aRunner [ ::xounit::TestRunner new ] set reporter [ ::xounit::CoverageReport new ] $reporter clear $reporter start foreach package $packages { package require "${package}" package require "${package}::test" puts "Loaded ${package}::test" $reporter addPackage ${package} } foreach package $packages { puts "Running ::${package}" $aRunner runAllTests ::${package}::test } my results [ concat [ $aRunner results ] [ my results ] ] my printResults $reporter reportPackages $packages $reporter reportSummary }