1
2context("Stress test on base R functions")
3
4do_pkg <- function(pkg) {
5  alln <- ls(asNamespace(pkg))
6  for (n in alln) {
7    expect_silent(
8      cyclocomp(get(n, asNamespace(pkg))),
9      info = paste0(pkg, "::", n)
10    )
11  }
12}
13
14expect_silent <- function(expr, info = NULL, label = NULL) {
15  out <- tryCatch(
16    evaluate_promise(expr),
17    error = function(e) stop("info: ", info, ", label: ", label)
18  )
19  expect_equal(out$output, "", info = info, label = label)
20  expect_equal(length(out$warnings), 0, info = info, label = label)
21  expect_equal(length(out$messages), 0, info = info, label = label)
22}
23
24test_that("some base packages", {
25
26  skip("Takes too long to run currently")
27
28  do_pkg("base")
29  do_pkg("stats")
30  do_pkg("utils")
31  do_pkg("methods")
32  do_pkg("graphics")
33})
34