Description Usage Arguments Value Note See Also
Converts all RUnit tests in a package to testthat tests, and writes them out to a file.
1 2 3 4 5 6 7 8 9 10 11 12 13 | convert_package_tests(pkg, test_dir = "inst/tests",
test_file_regexp = "^runit.+\\.[rR]", test_func_regexp = "^test.+",
testthat_files = stdout(), ...)
## S3 method for class 'package'
convert_package_tests(pkg, test_dir = "inst/tests",
test_file_regexp = "^runit.+\\.[rR]", test_func_regexp = "^test.+",
testthat_files = stdout(), ...)
## S3 method for class 'character'
convert_package_tests(pkg, test_dir = "inst/tests",
test_file_regexp = "^runit.+\\.[rR]", test_func_regexp = "^test.+",
testthat_files = stdout(), ...)
|
pkg |
Either a string containing a path to a package or a
|
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 |
... |
Not currently used. |
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")
.
RUnit
tests will be evaluated when they are read in, so make
sure that all your tests pass before you convert them.
convert_test_file
, convert_test
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.