From a297f5e4ac4292234ace2a98139ac186696322ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Thu, 16 Jan 2025 18:21:56 +0100 Subject: [PATCH] Fix test case It failed if the user had a Makevars file that changed CXXFLAGS. --- tests/testthat/test-withr.R | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/testthat/test-withr.R b/tests/testthat/test-withr.R index 3ab0b3b..1aadddf 100644 --- a/tests/testthat/test-withr.R +++ b/tests/testthat/test-withr.R @@ -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)