Learn R Programming

runittotestthat (version 0.0-2)

convert_package_tests: Convert a package worth of RUnit tests to testthat tests

Description

Converts all RUnit tests in a package to testthat tests, and writes them out to a file.

Usage

convert_package_tests(pkg, test_dir = "inst/tests", test_file_regexp = "^runit.+\\.[rR]", test_func_regexp = "^test.+", testthat_files = stdout(), ...)
"convert_package_tests"(pkg, test_dir = "inst/tests", test_file_regexp = "^runit.+\\.[rR]", test_func_regexp = "^test.+", testthat_files = stdout(), ...)
"convert_package_tests"(pkg, test_dir = "inst/tests", test_file_regexp = "^runit.+\\.[rR]", test_func_regexp = "^test.+", testthat_files = stdout(), ...)

Arguments

pkg
Either a string containing a path to a package or a devtools::package object.
test_dir
Directory inside the package containing test files.
test_file_regexp
Regular expression determining which files are considered to contain tests.
test_func_regexp
Regular expression determining which functions in the tests files are considered to be tests.
testthat_files
Character vector of paths for the output files. Defaults to stdout() to prevent you overwriting your existing test files. Use runit_files to refer to the original RUnit test files.
...
Not currently used.

Value

A list of lists of calls. Each call element is a testthat test. The names of the top level list correspond to the names of the input test files. The names of the sublists correspond to the names of the RUnit test functions in that file. Each list element has an environment containing the original RUnit, stored in attr(, "runit_tests").

See Also

convert_test_file, convert_test