| Title: | Automatic Package Testing |
|---|---|
| Description: | Automatic testing of R packages by tracing function calls made in examples and tests, then systematically varying the inputs to check that functions respond sensibly. |
| Authors: | Mark Padgham [aut, cre] (ORCID: <https://orcid.org/0000-0003-2172-5265>), Jouni Helske [ctb] (ORCID: <https://orcid.org/0000-0001-7130-793X>) |
| Maintainer: | Mark Padgham <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0.034 |
| Built: | 2026-08-04 15:14:29 UTC |
| Source: | https://github.com/ropensci-review-tools/autotest |
This function exists only to provide the class definitions for test objects, and is not intended to be called directly.
autotest_obj( package = NA_character_, package_loc = NULL, test_name = NA_character_, fn_name = NA_character_, parameters = list(), parameter_types = NA_character_, class = NULL, classes = NULL, env = new.env(), test = FALSE, quiet = FALSE )autotest_obj( package = NA_character_, package_loc = NULL, test_name = NA_character_, fn_name = NA_character_, parameters = list(), parameter_types = NA_character_, class = NULL, classes = NULL, env = new.env(), test = FALSE, quiet = FALSE )
package |
Name of package for which object is to be constructed. |
package_loc |
Location of package on local system (for source packages only) |
test_name |
Name of test (use autotest_types to get all test names). |
fn_name |
Name of function to be tested. |
parameters |
Names of all parameters for that function. |
parameter_types |
Types of input parameters. |
class |
Class of an individual parameter. |
classes |
Classes of all parameters. |
env |
Environment in which tests are to be run. |
test |
If |
quiet |
If |
Automatically test an entire package by tracing calls made in its documented examples (and, for local source packages, its test suite) with typetracer, then testing each traced function call in turn.
autotest_package( package = ".", functions = NULL, exclude = NULL, test = FALSE, test_data = NULL, progress = c("bar", "tests", "none") )autotest_package( package = ".", functions = NULL, exclude = NULL, test = FALSE, test_data = NULL, progress = c("bar", "tests", "none") )
package |
Name of package, as either
|
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 |
test_data |
Result returned from calling either autotest_types or
autotest_package with |
progress |
Style of progress display while testing functions, one of:
|
An autotest_package object which is derived from a tibble
tbl_df object. This has one row for each test, and the following eight
columns:
type The type of result, either "dummy" for test = FALSE, or one
of "error", "warning", "diagnostic", or "message".
test_name Name of each test
fn_name Name of function being tested
parameter Name of parameter being tested
parameter_type Expected type of parameter as identified by
autotest.
operation Description of the test
content For test = FALSE, the expected behaviour of the test; for
test = TRUE, the observed discrepancy with that expected behaviour
test If FALSE (default), list all tests without implementing them,
otherwise implement all tests.
Some columns may contain NA values, as explained in the Note.
Some columns may contain NA values, including:
parameer and parameter_type, for tests applied to entire
functions, such as tests of return values.
test_name for warnings or errors generated through "normal"
function calls generated directly from example code, in which case type
will be "warning" or "error", and content will contain the content of
the corresponding message.
Other main_functions:
autotest_types()
List all types of 'autotests' currently implemented.
autotest_types(notest = NULL)autotest_types(notest = NULL)
notest |
Character string of names of tests which should be switched off
by setting the |
An autotest object with each row listing one unique type of test
which can be applied to every parameter (of the appropriate class) of each
function.
Other main_functions:
autotest_package()
Expect autotest_package() to be clear of errors
expect_autotest_no_err(object)expect_autotest_no_err(object)
object |
An |
(invisibly) The same object
Other expectations:
expect_autotest_no_testdata(),
expect_autotest_no_warn(),
expect_autotest_notes(),
expect_autotest_testdata()
Expect autotest_package() to be clear of errors with no tests switched off
expect_autotest_no_testdata(object = NULL)expect_autotest_no_testdata(object = NULL)
object |
Not used here, but required for |
(invisibly) The autotest object
Other expectations:
expect_autotest_no_err(),
expect_autotest_no_warn(),
expect_autotest_notes(),
expect_autotest_testdata()
Expect autotest_package() to be clear of warnings
expect_autotest_no_warn(object)expect_autotest_no_warn(object)
object |
An |
(invisibly) The same object
Other expectations:
expect_autotest_no_err(),
expect_autotest_no_testdata(),
expect_autotest_notes(),
expect_autotest_testdata()
Expect test_data param of autotest_package to have additional note
column explaining why tests have been switched off.
expect_autotest_notes(object)expect_autotest_notes(object)
object |
An |
Other expectations:
expect_autotest_no_err(),
expect_autotest_no_testdata(),
expect_autotest_no_warn(),
expect_autotest_testdata()
Expect autotest_package() to be clear of errors with some tests switched
off, and to have note column explaining why those tests are not run.
expect_autotest_testdata(object)expect_autotest_testdata(object)
object |
An |
(invisibly) The autotest object
Other expectations:
expect_autotest_no_err(),
expect_autotest_no_testdata(),
expect_autotest_no_warn(),
expect_autotest_notes()