Learn R Programming

testCoverage (version 0.1.02)

testCoverage: Code coverage test files.

Description

testCoverage computes the code coverage that a unit test suite provides a set of source files.

Usage

testCoverage(sourcefiles, testfiles, ...)

Arguments

sourcefiles
character vector of source code filenames
testfiles
character vector of unit test filenames
...
parameters to pass onto reportCoverage

Value

A list containing summary coverage, errors and individual coverage. Side effect: A webpage of the report will be opened.

Details

This function is for testing disorganised source files for packages helper functions are available.

testthat tests are assumed by default, otherwise see reportCoverage for the necessary parameters.

See Also

reportCoverage, pkgCoverage, cranCoverage

Examples

Run this code
## Not run: 
# testCoverage(
#  system.file("examples/add/R/add.R", package = "testCoverage"),
#  system.file("examples/add/inst/tests/testthat/",
#   c("tests0/test_add0.R", "tests1/test_add1.R"), package = "testCoverage"))
# ## End(Not run)

Run the code above in your browser using DataLab