test_srcrefs_df {covtracer} | R Documentation |
Create a data.frame of coverage test srcref objects
Description
Extract unit test srcref
s from a
coverage
object. A test name will be
derived from the test source code, preferrably from a written annotation, but
otherwise falling back to using a code snippet. srcrefs
are unique for
each expression executed within a testing suite.
Usage
test_srcrefs_df(x)
Arguments
x |
A |
Value
A data.frame
of test srcrefs
extracted from a
coverage
object. Contains one record for each srcref
with
variables:
- name
-
A
character
test description. Fortestthat
tests, thedesc
parameter will be used, otherwise a snippet of code will be used for the test name - srcref
-
A
srcref
object describing the location of the test - test_type
-
A
character
indicating the structure of the test. One of"testthat"
,"call"
orNULL
See Also
srcrefs test_trace_mapping
Other srcrefs_df:
pkg_srcrefs_df()
,
trace_srcrefs_df()
Examples
options(covr.record_tests = TRUE)
pkg_path <- system.file("examplepkg", package = "covtracer")
cov <- covr::package_coverage(pkg_path)
test_srcrefs_df(cov)