Description Usage Arguments Value Examples
View source: R/file_coverage_runit.R
Extends the [covr::file_coverage()] function to also accept test files based on RUnit
1 2 3 | file_coverage_runit(source_files, test_files, load_package = FALSE,
testFileRegexp = "^test.+\\\\.R", testFuncRegexp = "^test.+",
unlink_tmp_dir = FALSE, ...)
|
source_files |
Character vector of pathes to source files with function definitions to measure coverage |
test_files |
Character vector of pathes to test files with code to test the functions |
load_package |
Boolean. If |
testFileRegexp |
Regular expression for matching test files. See [covr::runTestSuite()]. |
testFuncRegexp |
Regular expression for matching test functions. See [covr::runTestSuite()]. |
unlink_tmp_dir |
Boolean. When running [filecovrunit::package_coverage()] a package is created in R's temp directory. If |
... |
Additional arguments passed to [covr::package_coverage()] |
an covr object (identital to [covr::package_coverage()])
1 2 3 4 5 6 7 8 9 10 11 12 13 | # load test data
src <- c(system.file(file.path("extdata", "functions.R"), package = "filecovrunit"),
system.file(file.path("extdata", "functions2.R"), package = "filecovrunit"))
test <- c(system.file(file.path("extdata", "test_1.R"), package = "filecovrunit"),
system.file(file.path("extdata", "test_2.R"), package = "filecovrunit"))
# check file coverage of the files
cov <- filecovrunit::file_coverage_runit(source_files = src,
test_files = test,
load_package = FALSE)
cov
covr::report(cov)
filecovrunit::zero_coverage(cov)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.