Skip to content

Commit

Permalink
Fix test case
Browse files Browse the repository at this point in the history
It failed if the user had a Makevars file that changed
CXXFLAGS.
  • Loading branch information
gaborcsardi committed Jan 16, 2025
1 parent 6de0f01 commit a297f5e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/testthat/test-withr.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@

test_that("withr_with_makevars", {
skip_on_cran()
# need to run this without a user Makevars file
file.create(tmpmake <- tempfile())
on.exit(unlink(tmpmake), add = TRUE)
withr::local_envvar("R_MAKEVARS_USER" = tmpmake, R_MAKEVARS_SITE = tmpmake)

split_lines <- function(x) strsplit(x, "\n\r?")[[1]]

orig <- split_lines(callr::rcmd("config", "CFLAGS")$stdout)
Expand Down

0 comments on commit a297f5e

Please sign in to comment.