::xounit
Class RunProfile

Heritage:
::xotcl::Object
  |
  +--::xox::Node
        |
        +--::xounit::Test
              |
              +--::xounit::Assert
                    |
                    +--::xounit::TestCase
                          |
                          +--::xounit::Application
Class RunProfile
superclass ::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
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
 
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
NameComment
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

init

Description:
 Initialize the application with profile and packages from
 command line.  Run the unit tests and print results 
 for the unit tests and profile report.
Arguments:
Overrides:
init in ::xotcl::Object
Code:
  ::xounit::RunProfile instproc init {profile args}  {
   

        my set packages $args
        my set profile $profile
        my runApplication runTestApplication 
        my printResults
        ::xox::Profiler printReport 100
    
}

runTestApplication

Description:
 Main method for RunProfile Application.

 1) Load packages.
 2) Start watching profile class.
 3) Run unit tests in packages.
 4) Save results.
Code:
  ::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 ] ]
    
}