::xounit
Class TestResultsEmailFormatter

Heritage:
::xotcl::Object
  |
  +--::xounit::TestResultsTextFormatter
Class TestResultsEmailFormatter
superclass ::xounit::TestResultsTextFormatter,
Format test results for display in an email message.
Variables
NameDefault ValueClassComment
 
Methods
NameComment
formatResults {results}   Format a list of results and return the formatted string
printResult {aResult}   Format one TestResult and return the string
printSubResult {aResult}   Format a subtest 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

formatResults

Description:
 Format a list of results and return the formatted string.
Arguments:
Overrides:
formatResults in ::xounit::TestResultsTextFormatter
Code:
  ::xounit::TestResultsEmailFormatter instproc formatResults {results}  {
   

        set buffer ""

        append buffer [ my testSummary $results ]
        append buffer  "================================================================================\n"

        foreach result $results {

            if [ $result passed ] { continue }

            append buffer [ ::xotcl::my printResult $result ]

            append buffer  "================================================================================\n"
        }

        return $buffer
    
}

printResult

Description:
 Format one TestResult and return the string.
Arguments:
Overrides:
printResult in ::xounit::TestResultsTextFormatter
Code:
  ::xounit::TestResultsEmailFormatter instproc printResult {aResult}  {
   

        set buffer ""

        append buffer [ my printSubResult $aResult ]

        return $buffer
    
}

printSubResult

Description:
 Format a subtest result.
Arguments:
Overrides:
printSubResult in ::xounit::TestResultsTextFormatter
Code:
  ::xounit::TestResultsEmailFormatter instproc printSubResult {aResult}  {
   

        set buffer ""
        

        foreach result [ $aResult results ] {

            if [ $result hasclass ::xounit::TestError ] {

                append buffer "--------------------------------------------------------------------------------\n"
                append buffer "[ $aResult name ]\n"
                append buffer [ my printError $result  ]
                continue
            }

            if [ $result hasclass ::xounit::TestFailure ] {

                append buffer "--------------------------------------------------------------------------------\n"
                append buffer "[ $aResult name ]\n"
                append buffer [ my printFailure $result ]
                continue
            }

            append buffer [ my printSubResult $result ]
        }

        return $buffer
    
}