Automatically test an entire package by converting examples to yaml format
and submitting each to the autotest_yaml function.
Usage
autotest_package(
package = ".",
functions = NULL,
exclude = NULL,
test = FALSE,
test_data = NULL,
quiet = FALSE
)Arguments
- package
Name of package, as either
Path to local package source
Name of installed package
Full path to location of installed package if not on .libPaths, or
Default which presumes current directory is within package to be tested.
- functions
Optional character vector containing names of functions of nominated package to be included in 'autotesting'.
- exclude
Optional character vector containing names of any functions of nominated package to be excluded from 'autotesting'.
- test
If
FALSE, return only descriptions of tests which would be run withtest = TRUE, without actually running them.- test_data
Result returned from calling either autotest_types or autotest_package with
test = FALSEthat contains a list of all tests which would be conducted. These tests have an additional flag,test, which defaults toTRUE. Setting any tests toFALSEwill avoid running them whentest = TRUE.- quiet
If 'FALSE', provide printed output on screen.
Value
An autotest_package object which is derived from a tibble
tbl_df object. This has one row for each test, and the following nine
columns:
typeThe type of result, either "dummy" fortest = FALSE, or one of "error", "warning", "diagnostic", or "message".test_nameName of each testfn_nameName of function being testedparameterName of parameter being testedparameter_typeExpected type of parameter as identified byautotest.operationDescription of the testcontentFortest = FALSE, the expected behaviour of the test; fortest = TRUE, the observed discrepancy with that expected behaviourtestIfFALSE(default), list all tests without implementing them, otherwise implement all tests.yaml_hash' A unique hash which may be be used to extract theyaml` specification of each test.
Some columns may contain NA values, as explained in the Note.
Note
Some columns may contain NA values, including:
parameerandparameter_type, for tests applied to entire functions, such as tests of return values.test_namefor warnings or errors generated through "normal" function calls generated directly from example code, in which casetypewill be "warning" or "error", andcontentwill contain the content of the corresponding message.
See also
Other main_functions:
autotest_types()
