tests/testthat.R

library(testthat)

# parse the package name from the parent directory path (necessary because
# normal tests and R CMD Check tests are run from different directories)
x <- unlist(strsplit(gsub("(\\.Rcheck/tests)?$", "", getwd()), "/"))
pkgName <- x[length(x)]

library(pkgName, character.only = TRUE)

test_check(pkgName)
# [END]
deusbajaj/BCB420.2019.EGGNOG documentation built on May 8, 2019, 1:19 p.m.