local_package: Create a test package

View source: R/testing.R

local_packageR Documentation

Create a test package

Description

Creates a package in a temporary directory and sets the working directory until the local frame is destroyed.

Usage

local_package(
  pkg_name = fs::path_file(fs::file_temp("pkg")),
  branches = c("main", "devel"),
  r_sample = NULL,
  setwd = TRUE,
  envir = parent.frame()
)

Arguments

pkg_name

The name of the temporary package.

branches

Branches to be created.

r_sample

Character with code to write to R/sampleR.. This is helpful to validate if the installed package corresponds to source branch for testing. If NULL, nothing is written.

setwd

Whether or not the working directory should be temporarily set to the package root.

envir

⁠[environment]⁠
Attach exit handlers to this environment. Typically, this should be either the current environment or a parent frame (accessed through parent.frame()).

Details

This is primarily for testing.

See Also

Other testers: local_clean_touchstone()


lorenzwalthert/touchstone documentation built on April 20, 2024, 9:57 a.m.