Learn R Programming

tinytest (version 0.9.4)

build_install_test: build, install and test

Description

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

Usage

build_install_test(pkgdir = "./", testdir = "tinytest",
  at_home = TRUE, verbose = getOption("tt.verbose", TRUE),
  keep_tempdir = FALSE)

Arguments

pkgdir

[character] Package directory

testdir

[character] Name of directory under pkgdir/inst containing test files.

at_home

[logical] toggle local tests.

verbose

[logical] toggle verbosity during execution

keep_tempdir

[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.

Value

A tinytests object.

See Also

Other test-files: run_test_dir, run_test_file, summary.tinytests, test_package

Examples

Run this code
# 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