* using log directory ‘/data/gannet/ripley/R/packages/tests-noLD/discrimARTs.Rcheck’ * using R Under development (unstable) (2019-12-29 r77627) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘discrimARTs/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘discrimARTs’ version ‘0.2’ * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘discrimARTs’ can be installed ... OK * checking package directory ... OK * checking DESCRIPTION meta-information ... NOTE Malformed Title field: should not end in a period. * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... NOTE Packages in Depends field not imported from: ‘RUnit’ ‘grid’ These packages need to be imported from (in the NAMESPACE file) for when this namespace is loaded but not attached. * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... NOTE mix.distlist.facing.gamma : : no visible global function definition for ‘dgamma’ mix.distlist.norm: no visible binding for global variable ‘dnorm’ mix.mle: no visible global function definition for ‘sd’ mix.mle: no visible global function definition for ‘quantile’ mix.mle: no visible global function definition for ‘median’ mix.mle: no visible global function definition for ‘optim’ mix.synthetic.facing.gamma: no visible global function definition for ‘runif’ mix.synthetic.facing.gamma: no visible global function definition for ‘rgamma’ mix.synthetic.normal: no visible global function definition for ‘runif’ mix.synthetic.normal: no visible global function definition for ‘rnorm’ plot.discrimARTs: no visible global function definition for ‘hist’ plot.discrimARTs: no visible global function definition for ‘points’ plot.discrimARTs: no visible global function definition for ‘lines’ plot.discrimARTs: no visible global function definition for ‘grid.text’ plot.discrimARTs: no visible global function definition for ‘gpar’ Undefined global functions or variables: dgamma dnorm gpar grid.text hist lines median optim points quantile rgamma rnorm runif sd Consider adding importFrom("graphics", "hist", "lines", "points") importFrom("stats", "dgamma", "dnorm", "median", "optim", "quantile", "rgamma", "rnorm", "runif", "sd") to your NAMESPACE file. * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking contents of ‘data’ directory ... OK * checking data for non-ASCII characters ... OK * checking data for ASCII and uncompressed saves ... OK * checking examples ... OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘runTests.R’ ERROR Running the tests in ‘tests/runTests.R’ failed. Complete output: > pkg <- "discrimARTs" > > if(require("RUnit", quietly = TRUE)) { + + is_local <- function(){ + if( exists( "argv", globalenv() ) && "--local" %in% argv ) return(TRUE) + if( "--local" %in% commandArgs(TRUE) ) return(TRUE) + FALSE + } + if( is_local() ) path <- getwd() + + library(package=pkg, character.only = TRUE) + if(!(exists("path") && file.exists(path))) + path <- system.file("unitTests", package = pkg) + + ## --- Testing --- + ## Define tests + testSuite <- defineTestSuite(name=paste(pkg, "unit testing"), dirs = path) + + if(interactive()) { + cat("Now have RUnit Test Suite 'testSuite' for package '", pkg, + "' :\n", sep='') + str(testSuite) + cat('', "Consider doing", + "\t tests <- runTestSuite(testSuite)", "\nand later", + "\t printTextProtocol(tests)", '', sep="\n") + } else { ## run from shell / Rscript / R CMD Batch / ... + ## Run + tests <- runTestSuite(testSuite) + + output <- NULL + + process_args <- function(argv){ + if( !is.null(argv) && length(argv) > 0 ){ + rx <- "^--output=(.*)$" + g <- grep( rx, argv, value = TRUE ) + if( length(g) ){ + sub( rx, "\\1", g[1L] ) + } + } + } + + # R CMD check uses this + if( exists( "ARTs.unit.test.output.dir", globalenv() ) ){ + output <- ARTs.unit.test.output.dir + } else { + + # give a chance to the user to customize where he/she wants + # the unit tests results to be stored with the --output= command + # line argument + if( exists( "argv", globalenv() ) ){ + ## littler + output <- process_args(argv) + } else { + ## Rscript + output <- process_args(commandArgs(TRUE)) + } + } + + if( is.null(output) ) { # if it did not work, use parent dir + output <- ".." # as BDR does not want /tmp to be used + } + + ## Print results + output.txt <- file.path( output, sprintf("%s-unitTests.txt", pkg)) + output.html <- file.path( output, sprintf("%s-unitTests.html", pkg)) + + printTextProtocol(tests, fileName=output.txt) + message( sprintf( "saving txt unit test report to '%s'", output.txt ) ) + + ## Print HTML version to a file + ## printHTMLProtocol has problems on Mac OS X + if (Sys.info()["sysname"] != "Darwin"){ + message( sprintf( "saving html unit test report to '%s'", output.html ) ) + printHTMLProtocol(tests, fileName=output.html) + } + + ## stop() if there are any failures i.e. FALSE to unit test. + ## This will cause R CMD check to return error and stop + err <- getErrors(tests) + if( (err$nFail + err$nErr) > 0) { + stop( sprintf( "unit test problems: %d failures, %d errors", err$nFail, err$nErr) ) + } else{ + success <- err$nTestFunc - err$nFail - err$nErr - err$nDeactivated + cat( sprintf( "%d / %d\n", success, err$nTestFunc ) ) + } + } + } else { + cat("R package 'RUnit' cannot be loaded -- no unit tests run\n", + "for package", pkg,"\n") + } Loading required package: grid Executing test function test.facing_gamma.converge ... done successfully. Executing test function test.normal_default.converge ... Estimating initial conditions, assuming mix of normals Timing stopped at: 0.166 0.008 0.174 Error in checkEquals(mix.mle(x_gideon$horn)$convergence, 0, msg = "Convergence, default parameters (2 normals, estimated initial conditions") : Mean relative difference: 1 Convergence, default parameters (2 normals, estimated initial conditions done successfully. Executing test function test.normal_method.converge ... Estimating initial conditions, assuming mix of normals Timing stopped at: 0.145 0.001 0.217 Error in checkEquals(mix.mle(x_gideon$horn, method = "normal")$convergence, : Mean relative difference: 1 Convergence, 2 normals specified, estimated initial conditions done successfully. Executing test function test.normal_method_mix.prob.converge ... Estimating initial conditions, assuming mix of normals done successfully. saving txt unit test report to '../discrimARTs-unitTests.txt' saving html unit test report to '../discrimARTs-unitTests.html' Error: unit test problems: 2 failures, 0 errors Execution halted * checking PDF version of manual ... OK * checking for non-standard things in the check directory ... NOTE Found the following files/directories: ‘discrimARTs-unitTests.html’ ‘discrimARTs-unitTests.txt’ * checking for detritus in the temp directory ... OK * DONE Status: 1 ERROR, 4 NOTEs See ‘/data/gannet/ripley/R/packages/tests-noLD/discrimARTs.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 0:49.53, 27.71 + 4.96