
Run all tests in a package. Throw an error and print all failed test
results when one or more tests fail. This function is intended to be
used with R CMD check
and not for interactive use (use test_all
or build_install_test
instead). Tests that are only run
at_home
are skipped by default (as if it was run on CRAN).
test_package(pkgname, testdir = "tinytest", at_home = FALSE, ...)
[character]
scalar. Name of the package
[character]
scalar. Path to installed directory, relative
to the working directory of R CMD check
.
[logical]
scalar. Are we at home? (see Details)
extra arguments, passed to run_test_dir
We set at_home=FALSE
by default so R CMD check
will run the same
as at CRAN.
Other test-files: build_install_test
,
run_test_dir
, run_test_file
,
summary.tinytests
# NOT RUN {
# Create a file with the following content, to use
# tinytest as your unit testing framework:
if (requireNamespace("tinytest", quietly=TRUE))
test_package("your package name")
# }
Run the code above in your browser using DataLab