|
||||||
SUMMARY: CHILDREN | PARAMETER | INSTPROC | INSTFILTER | INSTFORWARD | DETAIL: | INSTPROC |
::xotcl::Object
Test is the simplest possible test and base class for all tests in xounit. The simplest possible test does nothing. That is what Test does. However it does provide a interface for Test subclasses to implement. This allows the test runner to be ignorant of how the test runs, and can run multiple types of tests together in one batch.
Variables | |||
Name | Default Value | Class | Comment |
Methods | |
Name | Comment |
?test {{prefix ""}}
| Finds all test methods that are available on this Test |
name {args}
| Sets the name for the test |
newResult {}
| returns a new instances of TestResult |
run {testResult}
| run is the method that will be called by test runners when they run this test |
runAlone {}
| runAlone creates a new TestResult from newResult, runs this test, and returns the result |
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 |
Finds all test methods that are available on this Test.
prefix
- optional, default value: ""
::xounit::Test instproc ?test {{prefix ""}} { return [ my ?methods "test$prefix" ] }
Sets the name for the test. If no name is provided this method returns the name of the class.
args
::xounit::Test instproc name {args} { if { [ llength $args ] == 0 } { if [ my exists name ] { return [ my set name ] } return [ my info class ] } return [ my set name [ lindex $args 0 ] ] }
returns a new instances of TestResult. Override this method if you need to create a special TestResult subclass for your Test subclass.
::xounit::Test instproc newResult {} { return [ TestResult new -name [ my name ] ] }
run is the method that will be called by test runners when they run this test. This method is meant to be overridden by subclasses and provides no functionality by default.
testResult
::xounit::Test instproc run {testResult} { }
runAlone creates a new TestResult from newResult, runs this test, and returns the result. This is useful if you have created a Test instance and want to run the test without a test runner.
::xounit::Test instproc runAlone {} { set result [ my newResult ] my run $result return $result }