Learn R Programming

covtracer (version 0.0.2)

test_trace_mapping: Create a data.frame mapping tests to coverage traces

Description

Extract a matrix used to relate test code to the traces that each test evaluates.

Usage

test_trace_mapping(x)

Value

A data.frame with one record for each line of code executed, with variables:

test

The index of the test that was executed, reflecting the order in which tests are executed

depth

The call stack depth when the coverage trace was evaluated

i

The index of the expression evaluated by each test. This can be used to recover an order of trace execution for a given test index

trace

The index of the coverage trace that was evaluated

Arguments

x

A coverage object produced with options(covr.record_tests = TRUE).

See Also

srcrefs_df srcrefs

Examples

Run this code
options(covr.record_tests = TRUE)
pkg_path <- system.file("examplepkg", package = "covtracer")
cov <- covr::package_coverage(pkg_path)
test_trace_mapping(cov)

Run the code above in your browser using DataLab