Running 'testthat.R' [21s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > 
  > if (require(testthat, quietly = TRUE) &&
  +     require(disposables, quietly = TRUE)) {
  +   library(pkgconfig)
  +   test_check("pkgconfig")
  + 
  + } else {
  +   cat("The testthat and disposables packages are required for unit tests")
  + }
  -- 1. Error: We can create a custom API (@test-api.R#7)  -----------------------
  package or namespace load failed for 'utility123456' in namespaceExport(ns, exports):
   undefined exports: f
  1: disposables::make_packages(utility123456 = {
         set_opt <- function(...) {
             pars <- list(...)
             names(pars) <- paste0("utility123456::", names(pars))
             do.call(pkgconfig::set_config_in, c(pars, list(.in = parent.frame())))
         }
         get_opt <- function(key) {
             real_key <- paste0("utility123456::", key)
             pkgconfig::get_config(real_key)
         }
     }, pkgA = {
         setter <- function() {
             utility123456::set_opt(key4 = "value_A")
         }
         getter <- function() {
             utility123456::get_opt("key4")
         }
     }, pkgB = {
         setter <- function() {
             utility123456::set_opt(key4 = "value_B")
         }
         getter <- function() {
             utility123456::get_opt("key4")
         }
     }) at testthat/test-api.R:7
  2: with_libpath(lib_dir, suppressMessages(library(name, quietly = TRUE, character.only = TRUE)))
  3: sapply(exprs, eval, envir = parent.frame())
  4: lapply(X = X, FUN = FUN, ...)
  5: FUN(X[[i]], ...)
  6: FUN(X[[i]], ...)
  7: suppressMessages(library(name, quietly = TRUE, character.only = TRUE))
  8: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  9: library(name, quietly = TRUE, character.only = TRUE)
  10: tryCatch({
         attr(package, "LibPath") <- which.lib.loc
         ns <- loadNamespace(package, lib.loc)
         env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)
     }, error = function(e) {
         P <- if (!is.null(cc <- conditionCall(e))) 
             paste(" in", deparse(cc)[1L])
         else ""
         msg <- gettextf("package or namespace load failed for %s%s:\n %s", sQuote(package), 
             P, conditionMessage(e))
         if (logical.return) 
             message(paste("Error:", msg), domain = NA)
         else stop(msg, call. = FALSE, domain = NA)
     })
  11: tryCatchList(expr, classes, parentenv, handlers)
  12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  13: value[[3L]](cond)
  14: stop(msg, call. = FALSE, domain = NA)
  
  Error in disposables::dispose_packages(pkgs) : object 'pkgs' not found
  -- 2. Error: Global env does not bother packages (@test-globalenv.R#11)  -------
  package or namespace load failed for 'pkgA' in namespaceExport(ns, exports):
   undefined exports: f
  1: disposables::make_packages(pkgA = {
         setter <- function() {
             set_config(key3 = "value2")
         }
         getter <- function() {
             utility123456::getter()
         }
     }, utility123456 = {
         getter <- function() {
             get_config("key3", "fallback")
         }
     }) at testthat/test-globalenv.R:11
  2: with_libpath(lib_dir, suppressMessages(library(name, quietly = TRUE, character.only = TRUE)))
  3: sapply(exprs, eval, envir = parent.frame())
  4: lapply(X = X, FUN = FUN, ...)
  5: FUN(X[[i]], ...)
  6: FUN(X[[i]], ...)
  7: suppressMessages(library(name, quietly = TRUE, character.only = TRUE))
  8: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  9: library(name, quietly = TRUE, character.only = TRUE)
  10: tryCatch({
         attr(package, "LibPath") <- which.lib.loc
         ns <- loadNamespace(package, lib.loc)
         env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)
     }, error = function(e) {
         P <- if (!is.null(cc <- conditionCall(e))) 
             paste(" in", deparse(cc)[1L])
         else ""
         msg <- gettextf("package or namespace load failed for %s%s:\n %s", sQuote(package), 
             P, conditionMessage(e))
         if (logical.return) 
             message(paste("Error:", msg), domain = NA)
         else stop(msg, call. = FALSE, domain = NA)
     })
  11: tryCatchList(expr, classes, parentenv, handlers)
  12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  13: value[[3L]](cond)
  14: stop(msg, call. = FALSE, domain = NA)
  
  Error in disposables::dispose_packages(pkgs) : object 'pkgs' not found
  -- 3. Error: Session variables (@tests.R#19)  ----------------------------------
  could not find function "g"
  1: expect_equal(g(), "bar") at testthat/tests.R:19
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  
  -- 4. Error: Composite values (@tests.R#40)  -----------------------------------
  could not find function "g"
  1: expect_equal(g(), list(1, 2, 3)) at testthat/tests.R:40
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  
  -- 5. Error: Two packages do not interfere (@tests.R#51)  ----------------------
  package or namespace load failed for 'pkgA' in namespaceExport(ns, exports):
   undefined exports: f
  1: disposables::make_packages(pkgA = {
         setter <- function() {
             pkgconfig::set_config(key = "A")
         }
         getter <- function() {
             utility123456::getter()
         }
     }, pkgB = {
         setter <- function() {
             pkgconfig::set_config(key = "B")
         }
         getter <- function() {
             utility123456::getter()
         }
     }, utility123456 = {
         getter <- function() {
             pkgconfig::get_config("key")
         }
     }) at testthat/tests.R:51
  2: with_libpath(lib_dir, suppressMessages(library(name, quietly = TRUE, character.only = TRUE)))
  3: sapply(exprs, eval, envir = parent.frame())
  4: lapply(X = X, FUN = FUN, ...)
  5: FUN(X[[i]], ...)
  6: FUN(X[[i]], ...)
  7: suppressMessages(library(name, quietly = TRUE, character.only = TRUE))
  8: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  9: library(name, quietly = TRUE, character.only = TRUE)
  10: tryCatch({
         attr(package, "LibPath") <- which.lib.loc
         ns <- loadNamespace(package, lib.loc)
         env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)
     }, error = function(e) {
         P <- if (!is.null(cc <- conditionCall(e))) 
             paste(" in", deparse(cc)[1L])
         else ""
         msg <- gettextf("package or namespace load failed for %s%s:\n %s", sQuote(package), 
             P, conditionMessage(e))
         if (logical.return) 
             message(paste("Error:", msg), domain = NA)
         else stop(msg, call. = FALSE, domain = NA)
     })
  11: tryCatchList(expr, classes, parentenv, handlers)
  12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  13: value[[3L]](cond)
  14: stop(msg, call. = FALSE, domain = NA)
  
  Error in disposables::dispose_packages(pkgs) : object 'pkgs' not found
  -- 6. Error: Cannot get if set by another package (@tests.R#80)  ---------------
  package or namespace load failed for 'pkgconfigtest1' in namespaceExport(ns, exports):
   undefined exports: f
  1: disposables::make_packages(pkgconfigtest1 = {
         getter <- function() {
             get_config("foo")
         }
         getter_parent <- function() {
             getter()
         }
     }, pkgconfigtest2 = {
         setter <- function() {
             set_config(foo = "bar")
         }
     }) at testthat/tests.R:80
  2: with_libpath(lib_dir, suppressMessages(library(name, quietly = TRUE, character.only = TRUE)))
  3: sapply(exprs, eval, envir = parent.frame())
  4: lapply(X = X, FUN = FUN, ...)
  5: FUN(X[[i]], ...)
  6: FUN(X[[i]], ...)
  7: suppressMessages(library(name, quietly = TRUE, character.only = TRUE))
  8: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  9: library(name, quietly = TRUE, character.only = TRUE)
  10: tryCatch({
         attr(package, "LibPath") <- which.lib.loc
         ns <- loadNamespace(package, lib.loc)
         env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)
     }, error = function(e) {
         P <- if (!is.null(cc <- conditionCall(e))) 
             paste(" in", deparse(cc)[1L])
         else ""
         msg <- gettextf("package or namespace load failed for %s%s:\n %s", sQuote(package), 
             P, conditionMessage(e))
         if (logical.return) 
             message(paste("Error:", msg), domain = NA)
         else stop(msg, call. = FALSE, domain = NA)
     })
  11: tryCatchList(expr, classes, parentenv, handlers)
  12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  13: value[[3L]](cond)
  14: stop(msg, call. = FALSE, domain = NA)
  
  Error in disposables::dispose_packages(pkgs) : object 'pkgs' not found
  -- 7. Error: Setting from .onLoad works fine (@tests.R#98)  --------------------
  package or namespace load failed for 'utility123456' in namespaceExport(ns, exports):
   undefined exports: f
  1: disposables::make_packages(utility123456 = {
         getter <- function() {
             pkgconfig::get_config("key", "fallback")
         }
     }, pkgA = {
         .onLoad <- function(lib, pkg) {
             pkgconfig::set_config(key = "A")
         }
         getter <- function() {
             utility123456::getter()
         }
     }, pkgB = {
         .onLoad <- function(lib, pkg) {
             pkgconfig::set_config(key = "B")
         }
         getter <- function() {
             utility123456::getter()
         }
     }, pkgC = {
         getter <- function() {
             utility123456::getter()
         }
     }) at testthat/tests.R:98
  2: with_libpath(lib_dir, suppressMessages(library(name, quietly = TRUE, character.only = TRUE)))
  3: sapply(exprs, eval, envir = parent.frame())
  4: lapply(X = X, FUN = FUN, ...)
  5: FUN(X[[i]], ...)
  6: FUN(X[[i]], ...)
  7: suppressMessages(library(name, quietly = TRUE, character.only = TRUE))
  8: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  9: library(name, quietly = TRUE, character.only = TRUE)
  10: tryCatch({
         attr(package, "LibPath") <- which.lib.loc
         ns <- loadNamespace(package, lib.loc)
         env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)
     }, error = function(e) {
         P <- if (!is.null(cc <- conditionCall(e))) 
             paste(" in", deparse(cc)[1L])
         else ""
         msg <- gettextf("package or namespace load failed for %s%s:\n %s", sQuote(package), 
             P, conditionMessage(e))
         if (logical.return) 
             message(paste("Error:", msg), domain = NA)
         else stop(msg, call. = FALSE, domain = NA)
     })
  11: tryCatchList(expr, classes, parentenv, handlers)
  12: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  13: value[[3L]](cond)
  14: stop(msg, call. = FALSE, domain = NA)
  
  Error in disposables::dispose_packages(pkgs) : object 'pkgs' not found
  == testthat results  ===========================================================
  [ OK: 3 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 7 ]
  1. Error: We can create a custom API (@test-api.R#7) 
  2. Error: Global env does not bother packages (@test-globalenv.R#11) 
  3. Error: Session variables (@tests.R#19) 
  4. Error: Composite values (@tests.R#40) 
  5. Error: Two packages do not interfere (@tests.R#51) 
  6. Error: Cannot get if set by another package (@tests.R#80) 
  7. Error: Setting from .onLoad works fine (@tests.R#98) 
  
  Error: testthat unit tests failed
  Execution halted