Skip to content

Commit

Permalink
stderr > stdout for rcmdcheck_process
Browse files Browse the repository at this point in the history
To keep output correctly interleaved.

Closes #148.
  • Loading branch information
gaborcsardi committed Sep 9, 2021
1 parent 22e242d commit 118aa22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 4 additions & 3 deletions R/background.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ rcc_init <- function(self, private, super, path, args, build_args,
cmdargs = c(basename(targz), args),
libpath = libpath,
repos = repos,
user_profile = TRUE
user_profile = TRUE,
stderr = "2>&1"
)

with_envvar(
Expand All @@ -172,8 +173,8 @@ rcc_parse_results <- function(self, private) {
if (self$is_alive()) stop("Process still alive")

## Make sure all output is read out
self$read_output_lines()
self$read_error_lines()
if (self$has_output_connection()) self$read_output_lines()
if (self$has_error_connection()) self$read_error_lines()

on.exit(unlink(private$tempfiles, recursive = TRUE), add = TRUE)

Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-rcmdcheck.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ test_that("background gives same results", {
test_path("bad1"),
libpath = c(tmp_lib, .libPaths()))
# If we read out the output, it'll still save it internally
bad1$read_output()
bad1$read_error()
bad1$read_all_output_lines()
res <- bad1$parse_results()

Expand Down

0 comments on commit 118aa22

Please # to comment.