printTextProtocol
prints a plain text protocol of a test run.
The resulting test protocol can be configured through the function
arguments.
printHTMLProtocol
prints an HTML protocol of a test run.
For long outputs this version of the test protocol is slightly more
readable than the plain text version due to links in the document.
The resulting test protocol can be configured through the function arguments.
printJUnitProtocol
prints a JUnit-style XML protocol of a test run.
This feature is especially useful when running your RUnit tests through
a continuous integration server that understands JUnit (like Jenkins).
This machine-parseable output allows you to track errors over time,
sort by execution time and similar useful tricks.
To take advantage of this function, you have to have the XML package installed.
print
prints the number of executed test functions and the
number of failures and errors.
summary
directly delegates the work to
printTextProtocol
.
getErrors
returns a list containing the number of test
functions, the number of deactivated functions (if there are any), the
number of errors and the number of failures.
printTextProtocol(testData, fileName = "",
separateFailureList = TRUE,
showDetails = TRUE, traceBackCutOff = 9)
printHTMLProtocol(testData, fileName = "",
separateFailureList = TRUE,
traceBackCutOff = 9,
testFileToLinkMap = function(x) x )
printJUnitProtocol(testData, fileName = "")
# S3 method for RUnitTestData
print(x, ...)
# S3 method for RUnitTestData
summary(object, ...)
getErrors(testData)
objects of class RUnitTestData
, typically
obtained as return value of a test run.
Connection where to print the text protocol (printing
is done by the cat
command).
If TRUE
a separate list of failures
and errors is produced at the top of the protocol. Otherwise, the
failures and errors are only listed in the details section.
If TRUE
the protocol contains a detailed listing of
all executed test functions.
The details section of the test protocol contains the call stack for
all errors. The first few entries of the complete stack typically
contain the internal RUnit function calls that execute the test cases and
are irrelevant for debugging. This argument specifies how many calls
are removed from the stack before it is written to the protocol. The
default value is chosen such that all uninteresting RUnit calls are
removed from the stack if runTestSuite
has been called from
the console. This argument takes effect only if
showDetails=TRUE
.
This function can be used to map the full name of the test file to a corresponding html link to be used in the html protocol. By default, this is the identity map. See example below.
additional arguments to summary are passed on to the printTextProtocol() call.
Thomas König, Klaus Jünemann, Matthias Burger & Roman Zenka
The text protocol can roughly be divided into three sections with an
increasing amount of information. The first section as an overview just reports the
number of executed test functions and the number of failures and
errors. The second section describes all test suites. Optionally, all
errors and failures that occurred in some test suite are listed.
In the optional third section details are given about all executed
test functions in the order they were processed. For each test file
all test functions executed are listed in the order they were executed. After the test
function name the number of check<*>
function calls inside the
test case and the execution time in seconds are stated. In the
case of an error or failure as much debug
information as possible is provided.
runTestSuite