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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri May 7 18:15:01 CEST 2010


Author: romain
Date: 2010-05-07 18:15:00 +0200 (Fri, 07 May 2010)
New Revision: 1187

Modified:
   pkg/Rcpp/inst/doc/unitTests/Rcpp-unitTests.R
Log:
make R CMD build fail when there is an unit test failure in the vignette

Modified: pkg/Rcpp/inst/doc/unitTests/Rcpp-unitTests.R
===================================================================
--- pkg/Rcpp/inst/doc/unitTests/Rcpp-unitTests.R	2010-05-07 11:30:32 UTC (rev 1186)
+++ pkg/Rcpp/inst/doc/unitTests/Rcpp-unitTests.R	2010-05-07 16:15:00 UTC (rev 1187)
@@ -11,6 +11,10 @@
 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) )
+}
 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