Skip to content

Commit

Permalink
add unit test for recursive make support
Browse files Browse the repository at this point in the history
  • Loading branch information
pearsonca committed Nov 23, 2023
1 parent 48ca5e6 commit 3cc5f86
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/testthat/test-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,16 @@ test_that("as_mcmc.list() works", {
"Currently only CmdStanMCMC objects can be converted to mcmc.list"
)
})

test_that("get_cmdstan_flags() can be used recursively in `make`", {
tmp <- withr::local_tempfile()
writeLines(
"test:\n\t@Rscript --vanilla -e 'cat(cmdstanr:::get_cmdstan_flags(\"STANCFLAGS\"))'",
tmp
)
nonrecursive_flags <- get_cmdstan_flags("STANCFLAGS")
recursive_flags <- readLines(textConnection(wsl_compatible_run(
command = "make", args = c("-f", tmp)
)$stdout))
expect_equal(nonrecursive_flags, recursive_flags)
})

0 comments on commit 3cc5f86

Please sign in to comment.