R version 4.5.0 beta (2025-03-29 r88074 ucrt) -- "How About a Twenty-Six" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > cli_fcn <- future.tests:::cli_fcn > check <- future.tests::check > > message("*** cli_fcn() ...") *** cli_fcn() ... > > options(future.tests.cmdargs = c("--help")) > print(check, call = TRUE) Usage: Rscript -e future.tests::check --args Options: --version Version of package --help Display this help --test-timeout= Sets per-test timeout in seconds --test-tags= Comma-separated tags specifying tests to include --test-plan= Future plan to test against --session-info Output session information at the end Examples: Rscript -e future.tests::check --args --help Rscript -e future.tests::check --args --test-plan=sequential Rscript -e future.tests::check --args --test-plan=multisession,workers=4 Rscript -e future.tests::check --args --test-plan=future.callr::callr Rscript -e future.tests::check --args --test-plan=future.batchtools::batchtools_local NULL > print(check, call = FALSE) function (plan = NULL, tags = character(), timeout = NULL, settings = TRUE, session_info = FALSE, envir = parent.frame(), local = TRUE, debug = FALSE, exit_value = !interactive(), .args = commandArgs()) { pkg <- "future" suppressPackageStartupMessages(require(pkg, character.only = TRUE)) || stop("Package not found: ", sQuote(pkg)) if (is.null(plan)) { } else { stopifnot(is.character(plan), !anyNA(plan), all(nzchar(plan))) } if (is.null(tags)) { } else { stopifnot(is.character(tags), !anyNA(tags), all(nzchar(tags))) } if (is.null(timeout)) { } else { stopifnot(is.numeric(timeout), length(timeout) == 1L, !is.na(timeout), timeout > 0) } test_plans("reset") action <- "check" for (kk in seq_along(.args)) { arg <- .args[kk] if (grepl("^--help$", arg)) { action <- "help" } else if (grepl("^--version$", arg)) { action <- "version" } else if (grepl("^--test-timeout=.*", arg)) { timeout <- as.numeric(gsub("--test-timeout=", "", arg)) stopifnot(!is.na(timeout), timeout > 0) } else if (grepl("^--test-plan=.*", arg)) { value <- gsub("^--test-plan=", "", arg) stopifnot(nzchar(value)) plan <- c(plan, value) } else if (grepl("^--test-tags=.*", arg)) { tags_kk <- gsub("^--test-tags=", "", arg) tags_kk <- unlist(strsplit(tags_kk, split = ",", fixed = TRUE)) tags <- unique(c(tags, tags_kk)) } else if ("^--session-info" == arg) { session_info <- TRUE } else if ("^--debug" == arg) { debug <- TRUE } } if (is.character(plan) && length(plan) >= 1L) { plan <- unique(plan) for (value in plan) { if (!grepl("plan(.*)$", value)) { value <- sprintf("plan(%s)", value) } expr <- parse(text = value) add_test_plan(expr, substitute = FALSE) } } test_plans <- test_plans() if (action == "check" && length(test_plans) == 0L) { action <- "help" } if (action == "help") { cat("Usage: Rscript -e future.tests::check --args \n") cat("\n") cat("Options:\n") cat(" --version Version of package\n") cat(" --help Display this help\n") cat(" --test-timeout= Sets per-test timeout in seconds\n") cat(" --test-tags= Comma-separated tags specifying tests to include\n") cat(" --test-plan= Future plan to test against\n") cat(" --session-info Output session information at the end\n") cat("\n") cat("Examples:\n") cat(" Rscript -e future.tests::check --args --help\n") cat(" Rscript -e future.tests::check --args --test-plan=sequential\n") cat(" Rscript -e future.tests::check --args --test-plan=multisession,workers=4\n") cat(" Rscript -e future.tests::check --args --test-plan=future.callr::callr\n") cat(" Rscript -e future.tests::check --args --test-plan=future.batchtools::batchtools_local\n") return(invisible()) } if (action == "version") { cat(as.character(packageVersion(.packageName)), "\n", sep = "") return(invisible()) } if (settings) { print(rule(left = "Settings", col = "cyan")) cat(sprintf("- future.tests version : %s\n", packageVersion("future.tests"))) cat(sprintf("- R_FUTURE_TESTS_ROOT : %s\n", Sys.getenv("R_FUTURE_TESTS_ROOT"))) cat(sprintf("- Option 'future.tests.root': %s\n", getOption("future.tests.root", "NULL"))) cat(sprintf("- Default test set folder : %s\n", system.file("test-db", package = "future.tests", mustWork = TRUE))) cat(sprintf("- Max number of workers : %s\n", availableCores())) cat(sprintf("- Timeout : %s\n", if (is.numeric(timeout)) sprintf("%g seconds", timeout) else "N/A")) cat("\n") } tests <- test_db() if (!is.null(tags)) tests <- subset_tests(tests, tags = tags) if (is.numeric(timeout)) options(future.tests.timeout = timeout) test_results <- list() for (pp in seq_along(test_plans)) { test_plan <- test_plans[[pp]] eval(test_plan) test_results[[pp]] <- check_plan(tests = tests, defaults = list(lazy = FALSE, globals = TRUE, stdout = TRUE), envir = envir, local = local) plan(sequential) } has_errors <- lapply(test_results, FUN = function(results) { lapply(results, FUN = function(sub_results) { lapply(sub_results, FUN = function(res) inherits(res$error, "error")) }) }) nbr_of_errors <- sum(unlist(has_errors, use.names = FALSE)) attr(test_results, "exit_code") <- if (nbr_of_errors == 0L) 0L else 1L if (session_info) { si <- session_info() print(si) } if (debug) { print(test_results) cat(sprintf("Total number of errors: %d\n", nbr_of_errors)) } if (exit_value && !interactive()) { quit(save = "no", status = attr(test_results, "exit_code"), runLast = TRUE) } invisible(test_results) } attr(,"class") [1] "cli_fcn" "function" > > citation <- cli_fcn(utils::citation) > print(citation) To cite R in publications use: R Core Team (2025). _R: A Language and Environment for Statistical Computing_. R Foundation for Statistical Computing, Vienna, Austria. . A BibTeX entry for LaTeX users is @Manual{, title = {R: A Language and Environment for Statistical Computing}, author = {{R Core Team}}, organization = {R Foundation for Statistical Computing}, address = {Vienna, Austria}, year = {2025}, url = {https://www.R-project.org/}, } We have invested a lot of time and effort in creating R, please cite it when using it for data analysis. See also 'citation("pkgname")' for citing R packages. NULL > > message("*** cli_fcn() ... DONE") *** cli_fcn() ... DONE > > proc.time() user system elapsed 1.85 0.18 2.03