runScripTests: Run the tests in the tests directory of a package

Description Usage Arguments Details Value Author(s)

Description

This function is not intended for interactive use, see runtests() for that. This function is intended to be called from the file runtests.R in the tests subdirectory of a package. The runtests.R file should contain these two lines:

1
2
3

Usage

1
2
3
4
runScripTests(..., initializeFun = Quote(initializeTests()),
              finalizeFun = Quote(summarizeTests()),
              diffFun = Quote(ScripDiff()),
              subst = NULL, pattern = NULL, quit = TRUE)

Arguments

...
initializeFun

Function for initializing tests.

finalizeFun

Function for finalizing tests – should compute a summary of test results.

diffFun

Function for checking differences between target output and actual test output.

subst
pattern

Only run tests whose filename matches this regular expression pattern.

quit

Call q("no") at the end? Ignored in interactive sessions.

Details

When runScripTests() runs, it will create a .R file with the commands extracted from each .Rt file. It will then run each .R file in a separate R session, save the output in a .Rout file, and compare the output with the .Rt file. runScripTests will leave a summary in the file test-summary.txt. If there are errors, the summary will be duplicated in the file test-summary.fail (the presence of a file ending in .fail signals an error to "R CMD check".)

Value

invisible(NULL)

Author(s)

Tony Plate tplate@acm.org


scriptests documentation built on May 1, 2019, 6:51 p.m.