[Rcpp-commits] r4055 - in pkg/Rcpp: . inst/unitTests tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Dec 1 16:38:08 CET 2012


Author: edd
Date: 2012-12-01 16:38:08 +0100 (Sat, 01 Dec 2012)
New Revision: 4055

Modified:
   pkg/Rcpp/DESCRIPTION
   pkg/Rcpp/inst/unitTests/runit.DataFrame.R
   pkg/Rcpp/inst/unitTests/runit.Vector.R
   pkg/Rcpp/inst/unitTests/runit.sugar.R
   pkg/Rcpp/tests/doRUnit.R
Log:
fix R CMD check not finding sourceCpp files
still needed
  -- actual Vector.cpp file :)
  -- reactivate runit.Vector.R
  -- set the global from the wrapper in tests/ too


Modified: pkg/Rcpp/DESCRIPTION
===================================================================
--- pkg/Rcpp/DESCRIPTION	2012-12-01 14:07:19 UTC (rev 4054)
+++ pkg/Rcpp/DESCRIPTION	2012-12-01 15:38:08 UTC (rev 4055)
@@ -1,6 +1,6 @@
 Package: Rcpp
 Title: Seamless R and C++ Integration
-Version: 0.10.1.1
+Version: 0.10.1.2
 Date: $Date$
 Author: Dirk Eddelbuettel and Romain Francois, with contributions 
  by Douglas Bates, John Chambers and JJ Allaire

Modified: pkg/Rcpp/inst/unitTests/runit.DataFrame.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.DataFrame.R	2012-12-01 14:07:19 UTC (rev 4054)
+++ pkg/Rcpp/inst/unitTests/runit.DataFrame.R	2012-12-01 15:38:08 UTC (rev 4055)
@@ -25,7 +25,8 @@
 .setUp <- function(){
 	suppressMessages( require( datasets ) )
 	data( iris )
-    sourceCpp( system.file( "unitTests/cpp/DataFrame.cpp" , package = "Rcpp" ) )
+    #sourceCpp( system.file( "unitTests/cpp/DataFrame.cpp" , package = "Rcpp" ) )
+    sourceCpp(file.path(pathRcppTests, "cpp/DataFrame.cpp"))
 }
 
 test.DataFrame.FromSEXP <- function() {
@@ -79,7 +80,7 @@
 }
 
 test.DataFrame.nrows <- function(){
-    checkEquals( DataFrame_nrows( iris ), nrow(iris) )  
+    checkEquals( DataFrame_nrows( iris ), nrow(iris) )
 }
 
 

Modified: pkg/Rcpp/inst/unitTests/runit.Vector.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.Vector.R	2012-12-01 14:07:19 UTC (rev 4054)
+++ pkg/Rcpp/inst/unitTests/runit.Vector.R	2012-12-01 15:38:08 UTC (rev 4055)
@@ -18,12 +18,13 @@
 # You should have received a copy of the GNU General Public License
 # along with Rcpp.  If not, see <http://www.gnu.org/licenses/>.
 
-.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
+.runThisTest <- FALSE ## Sys.getenv("RunAllRcppTests") == "yes"
 
 if (.runThisTest) {
 
 .setUp <- function() {
-    sourceCpp( system.file( "unitTests/cpp/Vector.cpp", package = "Rcpp" ) )
+    #sourceCpp( system.file( "unitTests/cpp/Vector.cpp", package = "Rcpp" ) )
+    sourceCpp(file.path(pathRcppTests, "cpp/Vector.cpp"))
 }
 
 test.RawVector <- function(){

Modified: pkg/Rcpp/inst/unitTests/runit.sugar.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.sugar.R	2012-12-01 14:07:19 UTC (rev 4054)
+++ pkg/Rcpp/inst/unitTests/runit.sugar.R	2012-12-01 15:38:08 UTC (rev 4055)
@@ -22,8 +22,9 @@
 
 if (.runThisTest) {
 
-.setUp <- function(){
-    sourceCpp( system.file( "unitTests/cpp/sugar.cpp", package = "Rcpp") )    
+.setUp <- function() {
+    #sourceCpp( system.file( "unitTests/cpp/sugar.cpp", package = "Rcpp") )
+    sourceCpp(file.path(pathRcppTests, "cpp/sugar.cpp"))
 }
 
 test.sugar.abs <- function( ){
@@ -664,12 +665,12 @@
 
 test.RangeIndexer <- function(){
     x <- rnorm(10)
-    checkEquals( runit_RangeIndexer(x), max(x[1:5]) )    
+    checkEquals( runit_RangeIndexer(x), max(x[1:5]) )
 }
 
 test.self_match <- function(){
     x <- sample( letters, 1000, replace = TRUE )
-    checkEquals( runit_self_match(x), match(x,unique(x)) )    
+    checkEquals( runit_self_match(x), match(x,unique(x)) )
 }
 
 test.table <- function(){

Modified: pkg/Rcpp/tests/doRUnit.R
===================================================================
--- pkg/Rcpp/tests/doRUnit.R	2012-12-01 14:07:19 UTC (rev 4054)
+++ pkg/Rcpp/tests/doRUnit.R	2012-12-01 15:38:08 UTC (rev 4055)
@@ -41,8 +41,8 @@
 
     pkg <- "Rcpp"                           # code below for Rcpp
     require(pkg, character.only=TRUE)
-    path <- system.file("unitTests", package = pkg)
-    stopifnot(file.exists(path), file.info(path.expand(path))$isdir)
+    pathRcppTests <<- system.file("unitTests", package = pkg)
+    stopifnot(file.exists(pathRcppTests), file.info(path.expand(pathRcppTests))$isdir)
 
     ## without this, we get unit test failures
     Sys.setenv( R_TESTS = "" )
@@ -58,7 +58,7 @@
 
     Rcpp.unit.test.output.dir <- getwd()
 
-    source(file.path(path, "runTests.R"), echo = TRUE)
+    source(file.path(pathRcppTests, "runTests.R"), echo = TRUE)
 
 } else {
     print("package RUnit not available, cannot run unit tests")



More information about the Rcpp-commits mailing list