Skip to content

Commit 3cc5f86

Browse files
committed
add unit test for recursive make support
1 parent 48ca5e6 commit 3cc5f86

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/testthat/test-utils.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,16 @@ test_that("as_mcmc.list() works", {
248248
"Currently only CmdStanMCMC objects can be converted to mcmc.list"
249249
)
250250
})
251+
252+
test_that("get_cmdstan_flags() can be used recursively in `make`", {
253+
tmp <- withr::local_tempfile()
254+
writeLines(
255+
"test:\n\t@Rscript --vanilla -e 'cat(cmdstanr:::get_cmdstan_flags(\"STANCFLAGS\"))'",
256+
tmp
257+
)
258+
nonrecursive_flags <- get_cmdstan_flags("STANCFLAGS")
259+
recursive_flags <- readLines(textConnection(wsl_compatible_run(
260+
command = "make", args = c("-f", tmp)
261+
)$stdout))
262+
expect_equal(nonrecursive_flags, recursive_flags)
263+
})

0 commit comments

Comments
 (0)