Builds and installs the package in pkgdir under a temporary
directory. Next, loads the package in a fresh R session and runs all the
tests. For this function to work the following system requirements are
necessary.
R CMD buildis available on your systemRscriptis available on your system
Usage
build_install_test(
pkgdir = "./",
testdir = "tinytest",
pattern = "^test.*\\.[rR]$",
at_home = TRUE,
verbose = getOption("tt.verbose", 2),
color = getOption("tt.pr.color", TRUE),
ncpu = 1,
remove_side_effects = TRUE,
side_effects = FALSE,
lc_collate = getOption("tt.collate", NA),
keep_tempdir = FALSE,
encoding = "unknown"
)Arguments
- pkgdir
[character]Package directory- testdir
[character]Name of directory underpkgdir/instcontaining test files.- pattern
[character]A regular expression that is used to find scripts indircontaining tests (by default.Ror.rfiles starting withtest).- at_home
[logical]toggle local tests.- verbose
[logical]toggle verbosity during execution- color
[logical]toggle colorize output- ncpu
[numeric]number of CPUs to use during the testing phase.- remove_side_effects
[logical]toggle remove user-defined side effects? See section on side effects.- side_effects
[logical|list]Either a logical, or a list of arguments to pass toreport_side_effects.- lc_collate
[character]Locale setting used to sort the test files into the order of execution. The defaultNAensures current locale is used. Set this e.g. to"C"to ensure bytewise and more platform-independent sorting (see details inrun_test_dir.- keep_tempdir
[logical]keep directory where the pkg is installed and where tests are run? IfTRUE, the directory is not deleted and it's location is printed.- encoding
[character]Encoding parameter passed toparse.
See also
Other test-files:
exit_file(),
run_test_dir(),
run_test_file(),
summary.tinytests(),
test_package()