|
||||||
| SUMMARY: CHILDREN | PARAMETER | INSTPROC | INSTFILTER | INSTFORWARD | DETAIL: | INSTPROC | |||||
::xotcl::Object
|
+--::xox::Node
|
+--::xounit::Test
|
+--::xounit::Assert
|
+--::xounit::TestCase
|
+--::xounit::Application
RunProfile is an Application that will report the usage, total time, and average time spent in each method for all instances of a profile class.
| 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::RunProfile | packages to load for unit tests |
|
profile |
::xounit::RunProfile | class to profile |
|
result |
::xounit::TestCase | the result for the current run. |
|
results |
"" | ::xounit::Application | failures, errors, and passes from Application execution |
| Methods | |
| Name | Comment |
init {profile args}
| Initialize the application with profile and packages from command line |
runTestApplication {}
| Main method for RunProfile 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 the application with profile and packages from command line. Run the unit tests and print results for the unit tests and profile report.
profile args ::xounit::RunProfile instproc init {profile args} {
my set packages $args
my set profile $profile
my runApplication runTestApplication
my printResults
::xox::Profiler printReport 100
}
Main method for RunProfile Application. 1) Load packages. 2) Start watching profile class. 3) Run unit tests in packages. 4) Save results.
::xounit::RunProfile instproc runTestApplication {} {
my instvar packages profile
set aRunner [ ::xounit::TestRunner new ]
foreach package $packages {
package require "${package}"
package require "${package}::test"
puts "Loaded ${package}::test"
}
::xox::Profiler add $profile
foreach package $packages {
puts "Running ::${package}"
$aRunner runAllTests ::${package}::test
}
my results [ concat [ $aRunner results ] [ my results ] ]
}