TestLogger

Declared In:

Introduction

Base class for loggers.



Member Functions

chomp

Removes the trailing newline from the text, if present.

initialize

Initializes this logger.

printColoredLine

Prints a string with the given color and starts a new line.

printColoredString

Prints the given text with the given style.

printCounts

Prints the counts of passed and skipped tests, failures, and errors.

printDefects

Prints detailed information about failures and errors.

printError

Prints the error string for the current test.

printFail

Prints the failure string for the current test.

printLine

Prints a string using the default color and starts a new line.

printResult

Prints "OK" or "FAILED" at the end of the test results.

printSkip

Prints the skip string for the current test.

printString

Prints a string using the default color.

printSuccess

Prints the success string for the current test.

printSummary

Prints a summary of the test results.

printTestCase

Prints the name of the current test.

printTitle

Prints the title of the test results.

setNotifier

Overrides Observer's setNotifier().

update

Logs the given event.


chomp


Removes the trailing newline from the text, if present.

on chomp(
    s)
Parameters
s

[text] A string.

Return Value

The string s with the trailing newline character removed, if any.


initialize


Initializes this logger.

on initialize()
Discussion

This handler may be overriden by subclasses to perform any needed initialization step. This handler is called automatically by autorun().


printColoredLine


Prints a string with the given color and starts a new line.

on printColoredLine(
    aString,
    aColor)
Parameters
aString

[text] The text to be printed.

aColor

[RGB color] The text color.


printColoredString


Prints the given text with the given style.

on printColoredString(
    aString,
    aColor)
Parameters
aString

[text] The text to be printed.

aColor

[RGB color] The text color.

Discussion

This handler must be implemented by subclasses.


printCounts


Prints the counts of passed and skipped tests, failures, and errors.


printDefects


Prints detailed information about failures and errors.

on printDefects(
    title,
    defects)
Parameters
title

[text] The type of defect (failures, errors). defects [list] The list of failures and errors.


printError


Prints the error string for the current test.

on printError()

printFail


Prints the failure string for the current test.

on printFail()

printLine


Prints a string using the default color and starts a new line.

on printLine(
    aString)
Parameters
aString

[text] The text to be printed.


printResult


Prints "OK" or "FAILED" at the end of the test results.


printSkip


Prints the skip string for the current test.

on printSkip()

printString


Prints a string using the default color.

on printString(
    aString)
Parameters
aString

[text] The text to be printed.


printSuccess


Prints the success string for the current test.


printSummary


Prints a summary of the test results.


printTestCase


Prints the name of the current test.

on printTestCase(
    aTestCase)
Parameters
aTestCase

[script] A test case.


printTitle


Prints the title of the test results.

on printTitle()

setNotifier


Overrides Observer's setNotifier().

on setNotifier(
    aTestResult)

update


Logs the given event.

on update(
    anEvent)
Parameters
anEvent

[record] An event. For the structure of an event, see notify() in TestResult.