tests/doRUnit.R

#### doRUnit.R --- Run RUnit tests
####------------------------------------------------------------------------

### borrowed from package Rcpp

### MM: Vastly changed:  This should also be "runnable" for *installed*
##              package which has no ./tests/
## ----> put the bulk of the code e.g. in  ../inst/unitTests/runTests.R :

if( identical( .Platform$OS.type, "windows" ) && identical( .Platform$r_arch, "x64" ) ){
    print( "unit tests not run on windows 64 (workaround alert)" )
} else {
    if(require("RUnit", quietly = TRUE)) {
      pkg <- "RcppModels"
                                           
      require( pkg, character.only=TRUE)
      
      path <- system.file("unitTests", package = pkg)
      
      stopifnot(file.exists(path), file.info(path.expand(path))$isdir)
      
      # without this, we get unit test failures
      Sys.setenv( R_TESTS = "" )
      
      Rcpp.unit.test.output.dir <- getwd()
      
      source(file.path(path, "runTests.R"), echo = TRUE)
      
    } else {
    	print( "package RUnit not available, cannot run unit tests" )
    }       
}

Try the RcppModels package in your browser

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

RcppModels documentation built on May 2, 2019, 4:19 p.m.