[Rcpp-commits] r4422 - in pkg/RcppArmadillo: . inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Aug 3 21:51:55 CEST 2013


Author: edd
Date: 2013-08-03 21:51:55 +0200 (Sat, 03 Aug 2013)
New Revision: 4422

Modified:
   pkg/RcppArmadillo/ChangeLog
   pkg/RcppArmadillo/inst/unitTests/runit.RcppArmadillo.R
   pkg/RcppArmadillo/inst/unitTests/runit.sample.R
Log:
improved unit test setup a little


Modified: pkg/RcppArmadillo/ChangeLog
===================================================================
--- pkg/RcppArmadillo/ChangeLog	2013-08-03 19:38:02 UTC (rev 4421)
+++ pkg/RcppArmadillo/ChangeLog	2013-08-03 19:51:55 UTC (rev 4422)
@@ -1,3 +1,8 @@
+2013-08-03  Dirk Eddelbuettel  <edd at debian.org>
+
+	* inst/unitTests/runit.RcppArmadillo.R: Improved test setup a little
+	* inst/unitTests/runit.sample.R: Ditto
+
 2013-08-02  Dirk Eddelbuettel  <edd at debian.org>
 
 	* DESCRIPTION: Release 0.3.900.7

Modified: pkg/RcppArmadillo/inst/unitTests/runit.RcppArmadillo.R
===================================================================
--- pkg/RcppArmadillo/inst/unitTests/runit.RcppArmadillo.R	2013-08-03 19:38:02 UTC (rev 4421)
+++ pkg/RcppArmadillo/inst/unitTests/runit.RcppArmadillo.R	2013-08-03 19:51:55 UTC (rev 4422)
@@ -19,7 +19,13 @@
 
 .setUp <- function(){
     suppressMessages(require(RcppArmadillo))
-    sourceCpp(file.path(pathRcppArmadilloTests, "cpp/armadillo.cpp"))
+    if (exists("pathRcppArmadilloTests")) {
+        sourceCpp(file.path(pathRcppArmadilloTests, "cpp", "armadillo.cpp"))
+    } else if (file.exists("cpp/armadillo.cpp")) {
+        sourceCpp("cpp/armadillo.cpp")
+    } else {
+        sourceCpp(system.file("unitTests", "cpp", "armadillo.cpp", package="RcppArmadillo"))
+    }
 }
 
 test.wrap.R <- function(){

Modified: pkg/RcppArmadillo/inst/unitTests/runit.sample.R
===================================================================
--- pkg/RcppArmadillo/inst/unitTests/runit.sample.R	2013-08-03 19:38:02 UTC (rev 4421)
+++ pkg/RcppArmadillo/inst/unitTests/runit.sample.R	2013-08-03 19:51:55 UTC (rev 4422)
@@ -19,7 +19,13 @@
 
 .setUp <- function(){
     suppressMessages(require(RcppArmadillo))
-    sourceCpp(file.path(pathRcppArmadilloTests, "cpp/sample.cpp"))
+    if (exists("pathRcppArmadilloTests")) {
+        sourceCpp(file.path(pathRcppArmadilloTests, "cpp", "armadillo.cpp"))
+    } else if (file.exists("cpp/sample.cpp")) {
+        sourceCpp("cpp/sample.cpp")
+    } else {
+        sourceCpp(system.file("unitTests", "cpp", "sample.cpp", package="RcppArmadillo"))
+    }
 }
 
 test.sample <- function() {



More information about the Rcpp-commits mailing list