scriptests (version 1.0-16)

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

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:
    library(scriptests)
    runScripTests()
    

Usage

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.

Value

invisible(NULL)

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".)