Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better recreate behaviour of examples in R CMD check #51

Closed
hadley opened this issue Jan 25, 2012 · 2 comments
Closed

Better recreate behaviour of examples in R CMD check #51

hadley opened this issue Jan 25, 2012 · 2 comments

Comments

@hadley
Copy link
Member

hadley commented Jan 25, 2012

  • tools:::.createExdotR and tools:::massageExamples

  • run_one_arch in tools:::.check_packages:

    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)
    }
@hadley
Copy link
Member Author

hadley commented Jan 25, 2012

May want to attempt to do it a function at a time to make checking easier. Key piece is probably to install package in temporary library, and then use appropriate libpath environment to evaluate code. This may be a simple hack to run_examples to use clean_source with appropriate libpath.

@hadley
Copy link
Member Author

hadley commented Jan 25, 2012

Should also return timings for all examples, and have option to continue on error.

@hadley hadley closed this as completed in 3d19697 Feb 8, 2012
@lock lock bot locked and limited conversation to collaborators Sep 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant