Skip to content

Commit 7523da8

Browse files
committed
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
1 parent bba8485 commit 7523da8

5 files changed

Lines changed: 15 additions & 12 deletions

File tree

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: Rcpp
22
Title: Seamless R and C++ Integration
3-
Version: 0.10.1.1
3+
Version: 0.10.1.2
44
Date: $Date$
55
Author: Dirk Eddelbuettel and Romain Francois, with contributions
66
by Douglas Bates, John Chambers and JJ Allaire

inst/unitTests/runit.DataFrame.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ if (.runThisTest) {
2525
.setUp <- function(){
2626
suppressMessages( require( datasets ) )
2727
data( iris )
28-
sourceCpp( system.file( "unitTests/cpp/DataFrame.cpp" , package = "Rcpp" ) )
28+
#sourceCpp( system.file( "unitTests/cpp/DataFrame.cpp" , package = "Rcpp" ) )
29+
sourceCpp(file.path(pathRcppTests, "cpp/DataFrame.cpp"))
2930
}
3031

3132
test.DataFrame.FromSEXP <- function() {
@@ -79,7 +80,7 @@ test.DataFrame.CreateTwo.stringsAsFactors <- function() {
7980
}
8081

8182
test.DataFrame.nrows <- function(){
82-
checkEquals( DataFrame_nrows( iris ), nrow(iris) )
83+
checkEquals( DataFrame_nrows( iris ), nrow(iris) )
8384
}
8485

8586

inst/unitTests/runit.Vector.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@
1818
# You should have received a copy of the GNU General Public License
1919
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
2020

21-
.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
21+
.runThisTest <- FALSE ## Sys.getenv("RunAllRcppTests") == "yes"
2222

2323
if (.runThisTest) {
2424

2525
.setUp <- function() {
26-
sourceCpp( system.file( "unitTests/cpp/Vector.cpp", package = "Rcpp" ) )
26+
#sourceCpp( system.file( "unitTests/cpp/Vector.cpp", package = "Rcpp" ) )
27+
sourceCpp(file.path(pathRcppTests, "cpp/Vector.cpp"))
2728
}
2829

2930
test.RawVector <- function(){

inst/unitTests/runit.sugar.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222

2323
if (.runThisTest) {
2424

25-
.setUp <- function(){
26-
sourceCpp( system.file( "unitTests/cpp/sugar.cpp", package = "Rcpp") )
25+
.setUp <- function() {
26+
#sourceCpp( system.file( "unitTests/cpp/sugar.cpp", package = "Rcpp") )
27+
sourceCpp(file.path(pathRcppTests, "cpp/sugar.cpp"))
2728
}
2829

2930
test.sugar.abs <- function( ){
@@ -664,12 +665,12 @@ test.sugar.signif <- function() {
664665

665666
test.RangeIndexer <- function(){
666667
x <- rnorm(10)
667-
checkEquals( runit_RangeIndexer(x), max(x[1:5]) )
668+
checkEquals( runit_RangeIndexer(x), max(x[1:5]) )
668669
}
669670

670671
test.self_match <- function(){
671672
x <- sample( letters, 1000, replace = TRUE )
672-
checkEquals( runit_self_match(x), match(x,unique(x)) )
673+
checkEquals( runit_self_match(x), match(x,unique(x)) )
673674
}
674675

675676
test.table <- function(){

tests/doRUnit.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ if (require("RUnit", quietly = TRUE)) {
4141

4242
pkg <- "Rcpp" # code below for Rcpp
4343
require(pkg, character.only=TRUE)
44-
path <- system.file("unitTests", package = pkg)
45-
stopifnot(file.exists(path), file.info(path.expand(path))$isdir)
44+
pathRcppTests <<- system.file("unitTests", package = pkg)
45+
stopifnot(file.exists(pathRcppTests), file.info(path.expand(pathRcppTests))$isdir)
4646

4747
## without this, we get unit test failures
4848
Sys.setenv( R_TESTS = "" )
@@ -58,7 +58,7 @@ if (require("RUnit", quietly = TRUE)) {
5858

5959
Rcpp.unit.test.output.dir <- getwd()
6060

61-
source(file.path(path, "runTests.R"), echo = TRUE)
61+
source(file.path(pathRcppTests, "runTests.R"), echo = TRUE)
6262

6363
} else {
6464
print("package RUnit not available, cannot run unit tests")

0 commit comments

Comments
 (0)