R Under development (unstable) (2024-08-26 r87056 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # we only run the tests, if svUnit is available > if (require(svUnit, quietly=TRUE)) { + pkg <- "distr" + require("distr") + + # we must investigate whether R CMD check is running or not + # and if the check is running, whether a time limit exists + RCMDCHECK <- FALSE + RCMDCHECKCRAN <- FALSE + + for (actual.name in names(Sys.getenv())) { + if (substr(actual.name, 1, 9) == "_R_CHECK_") { + RCMDCHECK <- TRUE + + if (actual.name == "_R_CHECK_TIMINGS_") { + RCMDCHECKCRAN <- (as.numeric(Sys.getenv("_R_CHECK_TIMINGS_")) > 0) + } + } + } + + # we must determine the path for tests in the installation and outside installation + if (RCMDCHECK) { + ## Path to unit tests for R CMD check + ## PKG.Rcheck/tests/../PKG/unitTests + ## PKG.Rcheck/tests/unitTests + + # we determine the two paths + pathTestsInInstallation <- system.file(package=pkg, "unitTests") + pathTestsOutsideInstallation <- file.path(getwd(), "unitTests") + } else { + ## Path to unit tests for standalone running as script with "PKG/tests" as working directory + ## PKG/tests/../inst/unitTests + ## PKG/tests/unitTests + + # we determine the two paths + pathTestsInInstallation <- file.path(getwd(), "..", "inst", "unitTests") + pathTestsOutsideInstallation <- file.path(getwd(), "unitTests") + } + + print(pathTestsInInstallation) + print(pathTestsOutsideInstallation) + + # it depends whether we want to skip the long running tests or not + if (RCMDCHECKCRAN) { + mypkgSuite <- svSuiteList(packages=pkg, dirs=pathTestsInInstallation) + } else { + mypkgSuite <- svSuiteList(packages=pkg, dirs=c(pathTestsInInstallation, pathTestsOutsideInstallation)) + } + + unlink("report.txt") # Make sure we generate a new report + + print(svSuiteList(packages=FALSE, dirs=c(pathTestsInInstallation, pathTestsOutsideInstallation))) + + runTest(mypkgSuite, name = pkg) # Run them... + + ## makeTestListFromExamples is in svUnit 0.7.8 or more + #doRunExamples <- TRUE + #svUnitVersion = as.integer(strsplit(installed.packages()[which(installed.packages()[, 'Package'] == "svUnit"), "Version"], "[\\.-]")[[1]]) + #if (svUnitVersion[1] == 0) { + # if (svUnitVersion[2] < 7) { + # doRunExamples <- FALSE + # } else { + # if (svUnitVersion[2] == 7) + # doRunExamples <- svUnitVersion[3] >= 8 + # } + #} + #if(doRunExamples) + # runTest(tryCatch(makeTestListFromExamples(pkg, "../../pkg/man/"), error=function(e) NULL)) + + + protocol(Log(), type = "text", file = "report.txt") # ... and write report + } Loading required package: distr Loading required package: startupmsg :startupmsg> Utilities for Start-Up Messages (version 0.9.6.1) :startupmsg> :startupmsg> For more information see ?"startupmsg", :startupmsg> NEWS("startupmsg") Loading required package: sfsmisc :distr> Object Oriented Implementation of Distributions (version :distr> 2.9.4) :distr> :distr> Attention: Arithmetics on distribution objects are :distr> understood as operations on corresponding random variables :distr> (r.v.s); see distrARITH(). :distr> :distr> Some functions from package 'stats' are intentionally masked :distr> ---see distrMASK(). :distr> :distr> Note that global options are controlled by distroptions() :distr> ---c.f. ?"distroptions". :distr> :distr> For more information see ?"distr", NEWS("distr"), as well as :distr> http://distr.r-forge.r-project.org/ :distr> Package "distrDoc" provides a vignette to this package as :distr> well as to several extension packages; try :distr> vignette("distr"). Attaching package: 'distr' The following objects are masked from 'package:stats': df, qqplot, sd [1] "" [1] "d:/RCompile/CRANincoming/R-devel/distr.Rcheck/tests/unitTests" A svUnit test suite definition with: - Test suite: [1] "dir:d:/RCompile/CRANincoming/R-devel/distr.Rcheck/tests/unitTests" > > > proc.time() user system elapsed 0.79 0.28 1.06