[Rcpp-commits] r1291 - pkg/Rcpp/tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu May 20 14:47:47 CEST 2010


Author: romain
Date: 2010-05-20 14:47:47 +0200 (Thu, 20 May 2010)
New Revision: 1291

Modified:
   pkg/Rcpp/tests/doRUnit.R
Log:
listen to the env var RCPP_DISABLE_UNIT_TESTS so that we can test other aspects of R CMD check more quickly (codocs, etc ...)

Modified: pkg/Rcpp/tests/doRUnit.R
===================================================================
--- pkg/Rcpp/tests/doRUnit.R	2010-05-20 12:43:45 UTC (rev 1290)
+++ pkg/Rcpp/tests/doRUnit.R	2010-05-20 12:47:47 UTC (rev 1291)
@@ -15,16 +15,21 @@
 if(require("RUnit", quietly = TRUE)) {
   pkg <- "Rcpp"
 
-  require( pkg, character.only=TRUE)
+  if( ! nzchar(Sys.getenv("RCPP_DISABLE_UNIT_TESTS")) ){  
+    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 many bunch of unit test failures
+    Sys.setenv( R_TESTS = "" )
+    
+    source(file.path(path, "runTests.R"), echo = TRUE)
+  } else{
+  	print( "unit test are disabled" )  
+  }
 
-  path <- system.file("unitTests", package = pkg)
-
-  stopifnot(file.exists(path), file.info(path.expand(path))$isdir)
-
-  # without this, we get many bunch of unit test failures
-  Sys.setenv( R_TESTS = "" )
-  
-  source(file.path(path, "runTests.R"), echo = TRUE)
 } else {
 	print( "package RUnit not available, cannot run unit tests" )
 }



More information about the Rcpp-commits mailing list