[Rcpp-commits] r2546 - pkg/Rcpp/inst/doc/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Nov 27 03:22:10 CET 2010


Author: edd
Date: 2010-11-27 03:22:10 +0100 (Sat, 27 Nov 2010)
New Revision: 2546

Modified:
   pkg/Rcpp/inst/doc/unitTests/Rcpp-unitTests.R
Log:
now stop on error only and warn (but continue) on failure


Modified: pkg/Rcpp/inst/doc/unitTests/Rcpp-unitTests.R
===================================================================
--- pkg/Rcpp/inst/doc/unitTests/Rcpp-unitTests.R	2010-11-27 02:21:41 UTC (rev 2545)
+++ pkg/Rcpp/inst/doc/unitTests/Rcpp-unitTests.R	2010-11-27 02:22:10 UTC (rev 2546)
@@ -15,15 +15,18 @@
 #load RUnit
 runit <- "RUnit" ; require( runit, character.only = TRUE )
 if( file.exists( "unitTests-results" ) ){ unlink("unitTests-results", recursive = TRUE ) }
-dir.create( "unitTests-results" ) 
+dir.create( "unitTests-results" )
 
 path <- system.file("unitTests", package = pkg)
 testSuite <- defineTestSuite(name=paste(pkg, "unit testing"), dirs = path)
 tests <- runTestSuite(testSuite)
 err <- getErrors(tests)
-if( (err$nFail + err$nErr) > 0) {
-    stop( sprintf( "unit test problems: %d failures, %d errors", err$nFail, err$nErr) )
+if( err$nFail > 0) {
+    warning(sprintf( "unit test problems: %d failures", err$nFail))
 }
+if( err$nErr > 0) {
+    stop( sprintf( "unit test problems: %d errors", err$nErr) )
+}
 printHTMLProtocol(tests, fileName= sprintf( "unitTests-results/%s-unitTests.html" , pkg ) )
 printTextProtocol(tests, fileName= sprintf( "unitTests-results/%s-unitTests.txt"  , pkg ) )
 if( file.exists( "/tmp" ) ){



More information about the Rcpp-commits mailing list