[Rcpp-commits] r3432 - in pkg/RcppModels: . inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Dec 23 15:15:32 CET 2011


Author: edd
Date: 2011-12-23 15:15:32 +0100 (Fri, 23 Dec 2011)
New Revision: 3432

Modified:
   pkg/RcppModels/ChangeLog
   pkg/RcppModels/inst/unitTests/runTests.R
Log:
modify fallback location of unitTest output files to be the RcppModels.Rcheck/ dir


Modified: pkg/RcppModels/ChangeLog
===================================================================
--- pkg/RcppModels/ChangeLog	2011-12-23 14:00:58 UTC (rev 3431)
+++ pkg/RcppModels/ChangeLog	2011-12-23 14:15:32 UTC (rev 3432)
@@ -1,3 +1,8 @@
+2011-12-23  Dirk Eddelbuettel  <edd at debian.org>
+
+	* inst/unitTests/runTests.R: unit tests output 'fallback' directory
+	changed to '..' and files are now in top-level of $pkg.Rcheck/
+
 2010-12-02  Douglas Bates  <bates at stat.wisc.edu>
 
 	* src/glmFamily.cpp, src/glmFamily.h: cache the Functions in the

Modified: pkg/RcppModels/inst/unitTests/runTests.R
===================================================================
--- pkg/RcppModels/inst/unitTests/runTests.R	2011-12-23 14:00:58 UTC (rev 3431)
+++ pkg/RcppModels/inst/unitTests/runTests.R	2011-12-23 14:15:32 UTC (rev 3432)
@@ -8,7 +8,7 @@
     	FALSE
     }
     if( is_local() ) path <- getwd()
-    
+
     library(package=pkg, character.only = TRUE)
     if(!(exists("path") && file.exists(path)))
         path <- system.file("unitTests", package = pkg)
@@ -28,9 +28,9 @@
     } 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=(.*)$"
@@ -40,9 +40,9 @@
         		}
         	}
         }
-        
-        # give a chance to the user to customize where he/she wants 
-        # the unit tests results to be stored with the --output= command 
+
+        # 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
@@ -51,23 +51,18 @@
         	# Rscript
         	output <- process_args(commandArgs(TRUE))
         }
-        
-        # if it did not work, try to use /tmp
-        if( is.null(output) ){
-        	if( file.exists( "/tmp" ) ){
-        		output <- "/tmp"
-        	} else{
-        		output <- getwd()
-        	}
+
+        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"){



More information about the Rcpp-commits mailing list