tests/testthat/computeRootPath.R

computeRootPath <- function() {
  g <- getwd()

  # for Rcheck
  if (grepl('.Rcheck', g, fixed = TRUE))
    return(system.file(package = "wyz.code.rdoc"))

  # for covr - must be done prior test for testthat
  if (grepl('wyz.code.rdoc-tests/testthat', g, fixed = TRUE))
    return(system.file(package = "wyz.code.rdoc"))

  # for testthat
  if (grepl('tests/testthat', g, fixed = TRUE))
    return(normalizePath(file.path(g, '../..')))

  '.'
}

Try the wyz.code.rdoc package in your browser

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

wyz.code.rdoc documentation built on Oct. 6, 2021, 9:07 a.m.