R/check-shortcuts.R

Defines functions check_with_sanitizers check_with_valgrind check_with_rdevel check_with_rpatched check_with_rrelease check_with_roldrel check_on_centos check_on_solaris check_on_fedora check_on_ubuntu check_on_debian check_on_macos check_on_windows check_on_linux

Documented in check_on_centos check_on_debian check_on_fedora check_on_linux check_on_macos check_on_solaris check_on_ubuntu check_on_windows check_with_rdevel check_with_roldrel check_with_rpatched check_with_rrelease check_with_sanitizers check_with_valgrind

## Various OSes --------------------------------------------------------

#' Check an R package on an R-hub platform
#'
#' These functions provide a quick easy to use interface to check a
#' package on a platform with some particular aspect. Which platform
#' they use might change over time.
#'
#' @param ... Additional arguments are passed to [check()].
#' @return An [rhub_check] object.
#' @inheritParams check
#'
#' @export
#' @rdname check_shortcuts

check_on_linux <- function(path = ".", ...) {
  check(path = path, platforms = check_shortcut_platforms$linux, ...)
}

#' @export
#' @rdname check_shortcuts

check_on_windows <- function(path = ".", ...) {
  check(path = path, platforms = check_shortcut_platforms$windows, ...)
}

#' @export
#' @rdname check_shortcuts

check_on_macos <- function(path = ".", ...) {
  check(path = path, platforms = check_shortcut_platforms$macos, ...)
}

## Various Linux OSes --------------------------------------------------

#' @export
#' @rdname check_shortcuts

check_on_debian <- function(path = ".", ...) {
  check(path = path, platforms = check_shortcut_platforms$debian, ...)
}

#' @export
#' @rdname check_shortcuts

check_on_ubuntu <- function(path = ".", ...) {
  check(path = path, platforms = check_shortcut_platforms$ubuntu, ...)
}

#' @export
#' @rdname check_shortcuts

check_on_fedora <- function(path = ".", ...) {
  check(path = path, platforms = check_shortcut_platforms$fedora, ...)
}

#' @export
#' @rdname check_shortcuts

check_on_solaris <- function(path = ".", check_args =
                             "'--no-manual --no-build-vignettes'", ...) {
  check(path = path, platforms = check_shortcut_platforms$solaris,
        check_args = check_args, ...)
}

#' @export
#' @rdname check_shortcuts

check_on_centos <- function(path = ".", ...) {
  check(path = path, platforms = check_shortcut_platforms$centos, ...)
}

## R versions --------------------------------------------------------

#' @export
#' @rdname check_shortcuts

check_with_roldrel <- function(path = ".", ...) {
  check(path = path, platforms = check_shortcut_platforms$roldrel, ...)
}

#' @export
#' @rdname check_shortcuts

check_with_rrelease <- function(path = ".", ...) {
  check(path = path, platforms = check_shortcut_platforms$rrelease, ...)
}

#' @export
#' @rdname check_shortcuts

check_with_rpatched <- function(path = ".", ...) {
  check(path = path, platforms = check_shortcut_platforms$rpatched, ...)
}

#' @export
#' @rdname check_shortcuts

check_with_rdevel <- function(path = ".", ...) {
  check(path = path, platforms = check_shortcut_platforms$rdevel, ...)
}

## Extra checks --------------------------------------------------------

#' @export
#' @rdname check_shortcuts

check_with_valgrind <- function(path = ".", ...) {
  check(path = path, platforms = check_shortcut_platforms$valgrind,
        valgrind = TRUE, ...)
}

#' @export
#' @rdname check_shortcuts

check_with_sanitizers <- function(path = ".", ...) {
  check(path = path, platforms = check_shortcut_platforms$sanitizers, ...)
}

## -------------------------------------------------------------------


check_shortcut_platforms <- list(
  "linux"      = "debian-gcc-release",
  "windows"    = "windows-x86_64-release",
  "macos"      = "macos-highsierra-release",
  "valgrind"   = "debian-gcc-release",
  "sanitizers" = "linux-x86_64-rocker-gcc-san",
  "roldrel"    = "windows-x86_64-oldrel",
  "rrelease"   = "debian-gcc-release",
  "rpatched"   = "debian-gcc-patched",
  "rdevel"     = "debian-gcc-devel",
  "debian"     = "debian-gcc-release",
  "ubuntu"     = "ubuntu-gcc-release",
  "fedora"     = "fedora-gcc-devel",
  "centos"     = "linux-x86_64-centos6-epel",
  "solaris"    = "solaris-x86-patched"
)

Try the rhub package in your browser

Any scripts or data that you put into this service are public.

rhub documentation built on Aug. 31, 2022, 5:06 p.m.