Automatically test inputs to functions specified in a 'yaml' template.

autotest_yaml(
  yaml = NULL,
  filename = NULL,
  test = TRUE,
  test_data = NULL,
  quiet = FALSE
)

Arguments

yaml

A 'yaml' template as a character vector, either hand-coded or potentially loaded via readLines function or similar. Should generally be left at default of 'NULL', with template specified by 'filename' parameter.

filename

Name (potentially including path) of file containing 'yaml' template. See at_yaml_template for details of template. Default uses template generated by that function, and held in local './tests' directory.

test

If FALSE, return only descriptions of tests which would be run with test = TRUE, without actually running them.

test_data

Result returned from calling either autotest_types or autotest_package with test = FALSE that contains a list of all tests which would be conducted. These tests have an additional flag, test, which defaults to TRUE. Setting any tests to FALSE will avoid running them when test = TRUE.

quiet

If 'FALSE', provide printed output on screen.

Value

An autotest_pkg object, derived from a tibble, detailing instances of unexpected behaviour for every parameter of every function.

See also

Examples

if (FALSE) {
yaml_list <- examples_to_yaml (package = "stats", functions = "reshape")
res <- autotest_yaml (yaml = yaml_list)
}