Description Usage Arguments Details Examples
Use this function to extract tests from package source files.
In-source testing blocks are contained in blocks that are prevented
from running when sourced by an if(FALSE){...}
statement.
It also contains a documentation tag to denote a testing block.
1 2 3 4 5 6 7 |
pkg |
The root directory of the package. |
filter |
If specified, only tests from files matching this regular expression are extracted. |
verbose |
Print message? |
full.path |
Include full file paths in generated files.
TRUE, indicates full path,
FALSE, indicated only basename, and
NA(default) implies path relative to |
force |
Force test extraction even if the generated test file is newer than the corresponding source file. |
The first line of the block should look similar to
1 2 3 |
1 2 3 4 5 6 7 8 | ## Not run:
# Extract all files
extract_tests('.')
# Extract only files that start with 'Class-' or 'class-'
extract_tests('.', filter="^[Cc]lass-.*\\.[Rr]$")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.