Skip to contents

Run package tests using devtools::test(). Optionally filter tests by name pattern. The default "minimal" reporter returns failures and a final summary without per-file progress, which suits non-streaming tool clients. Use "compact" to include file starts, per-file results, and timings, or pass a testthat reporter name.

Usage

btw_tool_pkg_test(
  pkg = ".",
  filter = NULL,
  reporter = "minimal",
  `_intent` = ""
)

Arguments

pkg

Path to package directory. Defaults to '.'. Must be within current working directory.

filter

Optional regex to filter test files. Example: 'helper' matches 'test-helper.R'.

reporter

Either "minimal" (the default), "compact" (per-file progress and timing), or a testthat reporter name passed to devtools::test().

_intent

An optional string describing the intent of the tool use. When the tool is used by an LLM, the model will use this argument to explain why it called the tool.

Value

The output from devtools::test().