|
||||||
SUMMARY: CHILDREN | PARAMETER | INSTPROC | INSTFILTER | INSTFORWARD | DETAIL: | INSTPROC |
::xotcl::Object | +--::xounit::TestResultsTextFormatter
Format test failures and errors for display in text.
Variables | |||
Name | Default Value | Class | Comment |
Methods | |
Name | Comment |
numberOfErrors {results}
| Count the total number of test errors |
numberOfFailures {results}
| Count the total number of test failures |
numberOfPasses {results}
| Count the total number of tests that passed |
numberOfTests {results}
| Count the total number of tests run |
printError {anError}
| Format a TestError |
printFailure {aFailure}
| Format a TestFailure |
printResult {aResult}
| Format one TestResult and return the string |
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 |
Count the total number of test errors.
results
::xounit::TestFailuresTextFormatter instproc numberOfErrors {results} { set number 0 foreach result $results { incr number [ $result numberOfErrors ] } return $number }
Count the total number of test failures.
results
::xounit::TestFailuresTextFormatter instproc numberOfFailures {results} { set number 0 foreach result $results { incr number [ $result numberOfFailures ] } return $number }
Count the total number of tests that passed.
results
::xounit::TestFailuresTextFormatter instproc numberOfPasses {results} { set number 0 foreach result $results { incr number [ $result numberOfPasses ] } return $number }
Count the total number of tests run.
results
::xounit::TestFailuresTextFormatter instproc numberOfTests {results} { set number 0 foreach result $results { incr number [ $result numberOfTests ] } return $number }
Format a TestError
anError
::xounit::TestFailuresTextFormatter instproc printError {anError} { return "Error: [ $anError name ] [$anError test] [$anError error]\n\n" }
Format a TestFailure
aFailure
::xounit::TestFailuresTextFormatter instproc printFailure {aFailure} { return "Failure: [ $aFailure name ] [$aFailure test] [$aFailure error]\n\n" }
Format one TestResult and return the string.
aResult
::xounit::TestFailuresTextFormatter instproc printResult {aResult} { set buffer "" if { [ $aResult passed ]} { return } append buffer "Test Results: [ $aResult name ]\n" foreach error [ $aResult errors ] { append buffer [ my printError $error ] } foreach failure [ $aResult failures ] { append buffer [ my printFailure $failure ] } #append buffer "Errors : [ $aResult numberOfErrors ]\n" #append buffer "Failures : [ $aResult numberOfFailures ]\n" return $buffer }