::xounit
Class Application

Heritage:
::xotcl::Object
  |
  +--::xox::Node
        |
        +--::xounit::Test
              |
              +--::xounit::Assert
                    |
                    +--::xounit::TestCase
Direct Known Subclasses:
::xounit::PrintResults, ::xounit::RunCoverage, ::xounit::RunDocCoverage, ::xounit::RunProfile, ::xounit::RunSuite, ::xounit::RunSuiteContinuous, ::xounit::RunTest, ::xounit::RunTests,

Associated Test:
::xounit::test::TestApplication

Class Application
superclass ::xounit::TestCase,
Application is a base class for all executable
 applications.  It provides robust application
 execution by running inside a TestCase. Thus
 all asserts and subtests can be called as if
 in a unit test from within this application.

 That is - if you unit tests work then this
 application will work too.
Variables
NameDefault ValueClassComment
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
 
result    ::xounit::TestCase
 the result for the current run.
results  ""  ::xounit::Application
 failures, errors, and passes from Application execution
 
Methods
NameComment
printResults {}   Print results collected from executing this Application
runApplication {method}   Run the main method of the application from within the robust test runner of TestCase
runApplicationAndReport {method}  
   
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

printResults

Description:
 Print results collected from executing this Application.
Code:
  ::xounit::Application instproc printResults {}  {
   

        my instvar results

        set formatter [ [ my formatterClass ] new ]

        $formatter printResults $results
    
}

runApplication

Description:
 Run the main method of the application from
 within the robust test runner of TestCase.
Arguments:
Code:
  ::xounit::Application instproc runApplication {method}  {
   

        set result [ ::xounit::TestResult new -name [ my name ] ]
        my runTest $result $method 
        if [ $result passed ] { return }
        my lappend results $result
    
}

runApplicationAndReport

Description:
 
Arguments:
Code:
  ::xounit::Application instproc runApplicationAndReport {method}  {
   

        my runApplication $method
        my printResults [ my results ]
    
}