tests/testthat/test-tally_coverage.R

test_that("tally_coverage includes compiled code", {
  skip_on_cran()
  skip_if(is_win_r41())

  cov <- package_coverage(test_path("TestCompiled"))
  tall <- tally_coverage(cov)

  expect_named(tall, c("filename", "functions", "line", "value"))

  expect_equal(
    unique(tall$filename),
    c("R/TestCompiled.R", "src/simple-header.h", "src/simple.cc", "src/simple4.cc"))
})

Try the covr package in your browser

Any scripts or data that you put into this service are public.

covr documentation built on Nov. 9, 2023, 9:07 a.m.