tests/testthat/test-no-timing.R

# CRAN runs the tests on slow machines and under valgrind, so a test must
# never check how long something takes.

test_that("no test checks an elapsed time", {
  files <- list.files(testthat::test_path(), pattern = "^test-.*[.]R$", full.names = TRUE)
  files <- setdiff(files, testthat::test_path("test-no-timing.R"))
  text <- unlist(lapply(files, readLines, warn = FALSE))
  timed <- grep("proc[.]time|system[.]time|Sys[.]time", text, value = TRUE)
  expect_identical(timed, character(0))
})

Try the LAGOtrials package in your browser

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

LAGOtrials documentation built on Dec. 4, 2026, 5:10 p.m.