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

View source: R/srcref_df.R

test_trace_mappingR Documentation

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)

Arguments

x

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

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

See Also

srcrefs_df srcrefs

Examples

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


covtracer documentation built on Sept. 12, 2024, 7:40 a.m.