tests/RUnit.R

Sys.unsetenv("R_TESTS")
if (requireNamespace("RUnit", quietly=TRUE) && requireNamespace("bspline", quietly=TRUE)) {
  testSuite <- RUnit::defineTestSuite(
    name = "bspline unit tests",
    dirs = system.file("unitTests", package = "bspline"),
    testFuncRegexp = "^[Tt]est.+",
    rngKind = "default",
    rngNormalKind = "default"
  )
  tests <- RUnit::runTestSuite(testSuite)

  RUnit::printTextProtocol(tests)

  if (RUnit::getErrors(tests)$nFail > 0) stop("RUnit test failure")
  if (RUnit::getErrors(tests)$nErr > 0) stop("Errors in RUnit tests")
}

Try the bspline package in your browser

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

bspline documentation built on April 4, 2025, 4:54 a.m.