Skip to content

Commit 035f5b7

Browse files
committed
reenable test_embedded_r along with use of sink()
1 parent 305567c commit 035f5b7

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2019-11-26 Dirk Eddelbuettel <[email protected]>
2+
3+
* inst/tinytest/test_embedded_r.R: Use sink to suppress noisy output,
4+
reenable tests (still conditional on usual environment variable)
5+
16
2019-11-25 Dirk Eddelbuettel <[email protected]>
27

38
* inst/tinytest/cpp/Vector.cpp (no_op): Suppress compiler warning

inst/tinytest/test_embedded_r.R

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
## Copyright (C) 2012 - 2016 Dirk Eddelbuettel and Romain Francois
2+
## Copyright (C) 2012 - 2019 Dirk Eddelbuettel and Romain Francois
33
##
44
## This file is part of Rcpp.
55
##
@@ -18,10 +18,7 @@
1818

1919
.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
2020

21-
## override -- skipping test for now as noisy
22-
.runThisTest <- FALSE
23-
24-
if (!.runThisTest) exit_file("Skipping 'test_embedded_r.R'")
21+
if (!.runThisTest) exit_file("Skipping, set 'RunAllRcppTests=yes' to run.")
2522

2623
library(Rcpp)
2724

@@ -31,9 +28,14 @@ expectedVars <- c("foo", "x")
3128

3229
## embeddedR.cpp exposes the function foo, R snippet calls foo
3330
newEnv <- new.env(parent = baseenv())
31+
32+
sink(tempfile()) # NB: silencing output
33+
3434
sourceCpp("cpp/embeddedR.cpp", env = newEnv)
3535
expect_equal(ls(newEnv), expectedVars, msg = "sourcing code in custom env")
3636

3737
## R snippet in embeddedR2.cpp also contains a call to foo from previous cpp
3838
newEnv2 <- new.env(parent = baseenv())
3939
expect_error(sourceCpp("cpp/embeddedR2.cpp", env = newEnv2), 'could not find function "foo"')
40+
41+
sink(NULL) # NB: restoring

0 commit comments

Comments
 (0)