Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions inst/unitTests/runit.embeddedR.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.

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

if (.runThisTest) {

Expand All @@ -27,13 +27,13 @@ if (.runThisTest) {
expectedVars <- c("foo", "x")

# embeddedR.cpp exposes the function foo, R snippet calls foo
newEnv <- new.env()
newEnv <- new.env(parent = baseenv())
Rcpp::sourceCpp(file.path(path, "embeddedR.cpp"),
env = newEnv)
checkEquals(ls(newEnv), expectedVars, msg = " sourcing code in custom env")

# R snippet in embeddedR2.cpp also contains a call to foo from previous cpp
newEnv2 <- new.env()
newEnv2 <- new.env(parent = baseenv())
checkException(Rcpp::sourceCpp(file.path(path, "embeddedR2.cpp"), env = newEnv2),
" not available in other env")
}
Expand Down