Text-based test controller for running HUnit tests and reporting results as text, usually to a terminal.
As the general text-based test controller (
runTestText) executes a
test, it reports each test case start, error, and failure by
constructing a string and passing it to the function embodied in a
PutText. A report string is known as a "line", although it includes
no line terminator; the function in a
PutText is responsible for
terminating lines appropriately. Besides the line, the function
receives a flag indicating the intended "persistence" of the line:
True indicates that the line should be part of the final overall
False indicates that the line merely indicates progress of
the test execution. Each progress line shows the current values of
the cumulative test execution counts; a final, persistent line shows
the final count values.
putTextToHandle writes persistent lines to the given handle,
following each by a newline character. In addition, if the given flag
True, it writes progress lines to the handle as well. A progress
line is written with no line termination, so that it can be
overwritten by the next report line. As overwriting involves writing
carriage return and blank characters, its proper effect is usually
only obtained on terminal devices.
Executes a test, processing each report line according to the given reporting scheme. The reporting scheme's state is threaded through calls to the reporting scheme's function and finally returned, along with final count values.
Converts a test case path to a string, separating adjacent elements by
the colon (':'). An element of the path is quoted (as with
there is potential ambiguity.