checks a list of source packages
Usage
pkgs_check(
pkgids = names(filter_srcpkgs(src_pkgs, filter)),
src_pkgs = get_srcpkgs(),
filter = NULL,
lib = ".check",
quiet = FALSE,
fail_on_error = FALSE,
...
)Arguments
- pkgids
a list of package ids (names, paths or object), or a srcpkgs object. Also accept a singleton package object
- src_pkgs
a collection of source packages as a
srckgsobject.- filter
filter out the packages to check using this pattern
- lib
directory where to install and find installed pkgs
- quiet
whether to be quiet/silent
- fail_on_error
whether to die if there is at least an error or warning in the checks
- ...
passed to
pkg_check
Examples
# \donttest{
pkg <- setup_and_get_dummy_srcpkg()
res <- pkgs_check(pkg, lib = tempfile(), fail_on_error = FALSE)
#>
#> ── installing packages in lib ──────────────────────────────────────────────────
#>
#> ── Checking package dummy.srcpkg ───────────────────────────────────────────────
#> ══ Building ════════════════════════════════════════════════════════════════════
#> Setting env vars:
#> • CFLAGS : -Wall -pedantic -fdiagnostics-color=always
#> • CXXFLAGS : -Wall -pedantic -fdiagnostics-color=always
#> • CXX11FLAGS: -Wall -pedantic -fdiagnostics-color=always
#> • CXX14FLAGS: -Wall -pedantic -fdiagnostics-color=always
#> • CXX17FLAGS: -Wall -pedantic -fdiagnostics-color=always
#> • CXX20FLAGS: -Wall -pedantic -fdiagnostics-color=always
#> ── R CMD build ─────────────────────────────────────────────────────────────────
#> * checking for file ‘/tmp/RtmpdftqsK/file1e6c695fd7d8/dummy_srcpkg/DESCRIPTION’ ... OK
#> * preparing ‘dummy.srcpkg’:
#> * checking DESCRIPTION meta-information ... OK
#> * checking for LF line-endings in source and make files and shell scripts
#> * checking for empty or unneeded directories
#> * creating default NAMESPACE file
#> * building ‘dummy.srcpkg_3.1416.tar.gz’
#>
#> ══ Checking ════════════════════════════════════════════════════════════════════
#> Setting env vars:
#> • _R_CHECK_CRAN_INCOMING_REMOTE_ : FALSE
#> • _R_CHECK_CRAN_INCOMING_ : FALSE
#> • _R_CHECK_FORCE_SUGGESTS_ : FALSE
#> • _R_CHECK_PACKAGES_USED_IGNORE_UNUSED_IMPORTS_: FALSE
#> • NOT_CRAN : true
#> ── R CMD check ─────────────────────────────────────────────────────────────────
#> * using log directory ‘/tmp/RtmpdftqsK/file1e6c7abfbc49/dummy.srcpkg.Rcheck’
#> * using R version 4.5.1 (2025-06-13)
#> * using platform: x86_64-pc-linux-gnu
#> * R was compiled by
#> gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
#> GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
#> * running under: Ubuntu 24.04.3 LTS
#> * using session charset: UTF-8
#> * using options ‘--no-manual --as-cran’
#> * checking for file ‘dummy.srcpkg/DESCRIPTION’ ... OK
#> * this is package ‘dummy.srcpkg’ version ‘3.1416’
#> * package encoding: UTF-8
#> * checking package namespace information ... OK
#> * checking package dependencies ... OK
#> * checking if this is a source package ... OK
#> * checking if there is a namespace ... OK
#> * checking for executable files ... OK
#> * checking for hidden files and directories ... OK
#> * checking for portable file names ... OK
#> * checking for sufficient/correct file permissions ... OK
#> * checking serialization versions ... OK
#> * checking whether package ‘dummy.srcpkg’ can be installed ... OK
#> * checking installed package size ... OK
#> * checking package directory ... OK
#> * checking for future file timestamps ... OK
#> * checking DESCRIPTION meta-information ... OK
#> * checking top-level files ... OK
#> * checking for left-over files ... OK
#> * checking index information ... OK
#> * checking package subdirectories ... OK
#> * checking code files for non-ASCII characters ... OK
#> * checking R files for syntax errors ... OK
#> * checking whether the package can be loaded ... OK
#> * checking whether the package can be loaded with stated dependencies ... OK
#> * checking whether the package can be unloaded cleanly ... OK
#> * checking whether the namespace can be loaded with stated dependencies ... OK
#> * checking whether the namespace can be unloaded cleanly ... OK
#> * checking loading without being on the library search path ... OK
#> * checking dependencies in R code ... OK
#> * checking S3 generic/method consistency ... OK
#> * checking replacement functions ... OK
#> * checking foreign function calls ... OK
#> * checking R code for possible problems ... OK
#> * checking for missing documentation entries ... WARNING
#> Undocumented code objects:
#> ‘does_nothing_special’
#> All user-level objects in a package should have documentation entries.
#> See chapter ‘Writing R documentation files’ in the ‘Writing R
#> Extensions’ manual.
#> * checking examples ... NONE
#> * checking for unstated dependencies in ‘tests’ ... OK
#> * checking tests ...
#> Running ‘testthat.R’
#> ERROR
#> Running the tests in ‘tests/testthat.R’ failed.
#> Last 13 lines of output:
#> > library(testthat)
#> > suppressPackageStartupMessages(library(dummy.srcpkg))
#> >
#> > test_check("dummy.srcpkg")
#> [ FAIL 1 | WARN 0 | SKIP 0 | PASS 1 ]
#>
#> ══ Failed tests ════════════════════════════════════════════════════════════════
#> ── Failure ('test_failure.R:3:3'): does_nothing_special - failure ──────────────
#> does_nothing_special() not equal to 0.
#> 1/1 mismatches
#> [1] 42 - 0 == 42
#>
#> [ FAIL 1 | WARN 0 | SKIP 0 | PASS 1 ]
#> Error: Test failures
#> Execution halted
#> * checking for non-standard things in the check directory ... OK
#> * checking for detritus in the temp directory ... OK
#> * DONE
#>
#> Status: 1 ERROR, 1 WARNING
#> See
#> ‘/tmp/RtmpdftqsK/file1e6c7abfbc49/dummy.srcpkg.Rcheck/00check.log’
#> for details.
#>
print(res)
#>
#> ── Check results by package ────────────────────────────────────────────────────
#> ╒════════════╤══════╤════════╤═════╤════╕
#> │ package │errors│warnings│notes│time│
#> ╞════════════╪══════╪════════╪═════╪════╡
#> │dummy.srcpkg│ 1 │ 1 │ 0 │7.32│
#> ╘════════════╧══════╧════════╧═════╧════╛
#>
#> ── Check results overview ──────────────────────────────────────────────────────
#> ╒═══════╤══════╤════════╤═════╤════╕
#> │package│errors│warnings│notes│time│
#> ╞═══════╪══════╪════════╪═════╪════╡
#> │ 1 │ 1 │ 1 │ 0 │7.32│
#> ╘═══════╧══════╧════════╧═════╧════╛
#>
#> FAILED
# }