hadley/devtools — Issue #51: Better recreate behaviour of examples in R CMD check
Author: hadley
Created: 2012-01-25 17:23:33+00:00
State: open

* `tools:::.createExdotR` and `tools:::massageExamples`

* `run_one_arch` in `tools:::.check_packages`:

```R
status <- R_runR(NULL, c(Ropts, enc), c("LANGUAGE=en",
if (nzchar(arch)) env0, jitstr), stdout = exout,
stderr = exout, stdin = exfile, arch = arch)
if (status) {
errorLog(Log, "Running examples in ", sQuote(exfile),
" failed")
txt <- paste(readLines(exout, warn = FALSE),
collapse = "\n")
chunks <- strsplit(txt, "> ### \\* [^\n]+\n> \n> flush[^\n]+\n> \n",
useBytes = TRUE)[[1L]]
if ((ll <- length(chunks)) >= 2) {
printLog(Log, "The error most likely occurred in:\n\n")
printLog0(Log, chunks[ll], "\n")
}
else {
printLog(Log, "The error occurred in:\n\n")
printLog0(Log, txt, "\n")
}
do_exit(1L)
}
```