Skip to content

Commit

Permalink
fix a couple of tests by actually capturing stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
Enchufa2 committed Jan 29, 2023
1 parent 48d819c commit 54ee8fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 2 additions & 3 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
2023-01-29 Dirk Eddelbuettel <edd@debian.org>
2023-01-29 Iñaki Ucar <iucar@fedoraproject.org>

* inst/tinytest/test_xptr.R: Condition one test writing to stdout
on test verbosity environment variable being set
* inst/tinytest/test_xptr.R: Fix a couple of tests writing to stdout

2023-01-24 Dirk Eddelbuettel <edd@debian.org>

Expand Down
8 changes: 3 additions & 5 deletions inst/tinytest/test_xptr.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,9 @@ void test() {
'

writeLines(code, file_path)
expect_silent(system(cmd), info="check that finalizer is NOT called on exit")
expect_equal(system(cmd, intern=TRUE), character(0))

if (packageVersion("tinytest") < "1.2.0") exit_file("Skip remainder on older test platform")

if (Sys.getenv("RunVerboseRcppTests") == "yes") {
writeLines(c("#define RCPP_USE_FINALIZE_ON_EXIT", code), file_path)
expect_stdout(system(cmd), info="check that finalizer is called on exit")
}
writeLines(c("#define RCPP_USE_FINALIZE_ON_EXIT", code), file_path)
expect_equal(system(cmd, intern=TRUE), "custom_finalizer was called")

0 comments on commit 54ee8fd

Please sign in to comment.