svTestData: Objects of class 'svTestData' contain results from running a...

Description Usage Arguments Value Author(s) See Also Examples

Description

The 'svTestData' contains results of test run. The checkxxx() functions and the runTest() method generate one such object which is located in the .Log object in .GlobalEnv. It is then possible to display and report information it contains in various ways to analyze the results.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
is.svTestData(x)

stats(object, ...)
## S3 method for class 'svTestData'
stats(object, ...)

## S3 method for class 'svTestData'
print(x, all = FALSE, header = TRUE, file = "",
	append = FALSE, ...)
## S3 method for class 'svTestData'
summary(object, header = TRUE, file = "",
	append = FALSE, ...)

Arguments

x

any kind of object, or a 'svTestData' object in the case of print.

object

a 'svTestData' object.

all

do we print concise report for all test, or only for the tests that fail or produce an error?

header

do we print a header or not?

file

character. The path to the file where to write the report. If file = "", the report is output to the console.

append

do we append to this file?

...

further arguments to pass to methods. Not used yet.

Value

is.svTestData() returns TRUE if the object is an 'svTestData'. The various methods serve to extract or print content in the object.

Author(s)

Philippe Grosjean <[email protected]>

See Also

svTest, svSuiteData, check, Log

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
foo <- function(x, y = 2) return(x * y)
is.test(foo)  # No
## Create test cases for this function
test(foo) <- function () {
	checkEqualsNumeric(4, foo(2))
	checkEqualsNumeric(5, foo(2, 3))
	checkEqualsNumeric(5, foo(nonexists))
}
## Generate a 'svTestData' object by running the test
obj <- runTest(foo)  # Equivalent to runTest(test(foo)), but shorter
obj
summary(obj)
stats(obj)
is.svTestData(obj)

rm(foo, obj)

svUnit documentation built on May 30, 2017, 4:25 a.m.