test: Execute Test Logic of the Test Case

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This method executes the test logic for a test case in a testthat reporter environment.

Usage

1
2
3
## S4 method for signature 'RTestCase'
test(object, test.for = NULL,
  out.fPathPre = NULL, ...)

Arguments

object

(object) The RTestCase-class object.

test.for

(vector(character)) Specification for which elements to test, NULL to test for all elements

out.fPathPre

(character) Prefix incl. path to output files generated during tetest

...

Additional arguments passed to the check function.

Details

This method performs the test logic by iterating through all testgroups as defined in the TC XML definition file. For each test group it starts a seperate 'ListReporter', which is defined in the testthat package. Then, the different functions of a testgroup are executed. Therefore, this function calls the method execTCAdapter, which needs to be defined for each TestCase type separatly (e.g. for DSTAT, VCA, Calib, etc.). This method is the adapter function and knows how to read the test case and how to execute the functions, which should be tested. Thereby, all test results generated using test_that and the expect_* of the testthat package are recorded by the previously started reporter object. The generated test results are stored (slot test.result) and the test execution status set (slot test.status).

Value

(RTestCase-class)

Author(s)

Matthias Pfeifer matthias.pfeifer@roche.com

See Also

RTestCase-class

Examples

1
2
3
4
5
6
7
8
location <- find.package("RTest")

TestCase <- RTestCase(xml.fPath =
  file.path(location,"xml-templates","RTest_TC-01.xml"))

result <- test(TestCase)

stopifnot(result@test.result == "success")

RTest documentation built on Dec. 4, 2019, 5:07 p.m.