Skip to content

Commit 1e54295

Browse files
committed
be more specific about where we load the package from
1 parent d13dc67 commit 1e54295

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

inst/unitTests/runit.binary.package.R

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ test.binary.testRcppPackage <- function() {
2727

2828
if (.runThisTest && .onLinux && .onTravis) {
2929

30-
pkg <- "r-cran-testrcpppackage"
30+
debpkg <- "r-cran-testrcpppackage"
31+
rpkg <- "testRcppPackage"
3132

3233
## R calls it i686 or x86_64; Debian/Ubuntu call it i386 or amd64
3334
arch <- switch(unname(Sys.info()["machine"]), "i686"="i386", "x86_64"="amd64")
3435

3536
## filename of pre-built
3637
debfile <- file.path(system.file("unitTests/bin", package="Rcpp"),
3738
arch,
38-
paste0(pkg, "_0.1.0-1_", arch, ".deb"))
39+
paste0(debpkg, "_0.1.0-1_", arch, ".deb"))
3940

4041
if (file.exists(debfile)) {
4142
system(paste("sudo dpkg -i", debfile))
@@ -48,12 +49,14 @@ test.binary.testRcppPackage <- function() {
4849
## [1] 0 1
4950

5051
## R>
52+
53+
require(rpkg, lib.loc = "/usr/lib/R/site-library", character.only = TRUE)
54+
hello_world <- get("rcpp_hello_world", asNamespace(rpkg))
5155

52-
res <- testRcppPackage:::rcpp_hello_world()
53-
checkEquals(res, list(c("foo", "bar"), c(0.0, 1.0)),
56+
checkEquals(hello_world(), list(c("foo", "bar"), c(0.0, 1.0)),
5457
msg = "code from binary package")
5558

56-
system(paste("sudo dpkg --purge", pkg))
59+
system(paste("sudo dpkg --purge", debpkg))
5760
}
5861
}
5962
}

0 commit comments

Comments
 (0)