Setup tinytest
Setting up the tinytest framework is covered in detail
in the documentation of tinytest. Quick
summary:
- In the package root directory, call
tinytest::setup_tinytest("."). - Edit/add R scripts with unit tests to the directory
inst/tinytest.
Setup checkmate
Edit your
DESCRIPTIONand addcheckmatetoSuggestsunless it is already listed inImportsfor its assertions.-
In each test file which calls an expectation from
checkmate, you must include the following lines at the beginning of the file:library("tinytest") library("checkmate") using("checkmate")If you forget the last line, expectations will not get reported correctly in the summary. Also note that sourcing a file which includes
using("checkmate")is not sufficient. Check if everything works with
R CMD check.