::xounit
Class RunCoverage

Heritage:
::xotcl::Object
  |
  +--::xox::Node
        |
        +--::xounit::Test
              |
              +--::xounit::Assert
                    |
                    +--::xounit::TestCase
                          |
                          +--::xounit::Application
Class RunCoverage
superclass ::xounit::Application,
RunCoverage is an application that reports
 the unit testing coverage for all methods
 in all classes in a set of packages.
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::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
NameComment
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

init

Description:
 Initialize and run the application using packages
 supplied by the command line.
Arguments:
Overrides:
init in ::xotcl::Object
Code:
  ::xounit::RunCoverage instproc init {args}  {
   

        my set packages $args
        my runApplication runTestApplication 
    
}

runTestApplication

Description:
 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.
Code:
  ::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 
    
}