code_coverage: Calculate coverage of code directly

Description Usage Arguments

View source: R/covr.R

Description

This function is useful for testing, and is a thin wrapper around file_coverage() because parseData is not populated properly unless the functions are defined in a file.

Usage

1
2
3
4
5
6
7
code_coverage(
  source_code,
  test_code,
  line_exclusions = NULL,
  function_exclusions = NULL,
  ...
)

Arguments

source_code

A character vector of source code

test_code

A character vector of test code

line_exclusions

a named list of files with the lines to exclude from each file.

function_exclusions

a vector of regular expressions matching function names to exclude. Example print\\\. to match print methods.

...

Additional arguments passed to file_coverage()


covr documentation built on March 13, 2020, 2:53 a.m.