run_test_impl: Implement a test run

View source: R/testing.R

run_test_implR Documentation

Implement a test run

Description

Implement a test run

Usage

run_test_impl(
  path_executable,
  path_candidate,
  std_err,
  std_out,
  cmd_args,
  artifacts,
  file_transformer,
  env,
  expect_success
)

Arguments

path_executable

The path to the executable bash script.

path_candidate

The path to a file that should be modified by the executable.

std_err

An expected error message. If no error is expected, this can be NULL. In that case, the comparator is applied.

std_out

The expected stdout message. If NULL, this check is omitted.

cmd_args

More arguments passed to the file. Pre-commit handles it as described here.

artifacts

Path with artifact files to copy to the temp directory root where the test is run. If you don't target the root, this can be a named vector of length one where the name is the target location relative to the temporary location and the value is the source of the file.

env

The environment variables to set with base::system2().

expect_success

Whether or not an exit code 0 is expected. This can be derived from std_err, but sometimes, non-empty stderr does not mean error, but just a message.


precommit documentation built on July 2, 2022, 1:06 a.m.