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 build
is available on your system
Rscript
is available on your system
build_install_test(
pkgdir = "./",
testdir = "tinytest",
pattern = "^test.*\\.[rR]$",
at_home = TRUE,
verbose = getOption("tt.verbose", 2),
ncpu = 1,
remove_side_effects = TRUE,
side_effects = FALSE,
lc_collate = getOption("tt.collate", NA),
keep_tempdir = FALSE
)
[character]
Package directory
[character]
Name of directory under pkgdir/inst
containing test files.
[character]
A regular expression that is used to find
scripts in dir
containing tests (by default .R
or .r
files starting with test
).
[logical]
toggle local tests.
[logical]
toggle verbosity during execution
[numeric]
number of CPUs to use during the testing phase.
[logical]
toggle remove user-defined side
effects? See section on side effects.
[logical|list]
Either a logical,
or a list of arguments to pass to report_side_effects
.
[character]
Locale setting used to sort the
test files into the order of execution. The default NA
ensures
current locale is used. Set this e.g. to "C"
to ensure bytewise
and more platform-independent sorting (see details in run_test_dir
.
[logical]
keep directory where the pkg is
installed and where tests are run? If TRUE
, the directory is not
deleted and it's location is printed.
A tinytests
object.
Other test-files:
exit_file()
,
run_test_dir()
,
run_test_file()
,
summary.tinytests()
,
test_package()
# NOT RUN {
## If your package source directory is "./pkg" you can run
build_install_test("pkg")
# }
Run the code above in your browser using DataLab