R CMD check
automatically runs tests located in tests/
directory. However running the tests this way requires building the package first. After that R CMD check
goes through various different sanity checks before finally reaching the tests at the end.
Question: Is there a way to run those tests without having to build or install the package first?
NOTE: without using testthat
or other non-standard packages.
To summarise our discussion.
R CMD check
for unit testing provided by base R R/
(and dyn.load everything under source/
) and then source everything under tests/
(actually, I also use the Example
sections of the help pages in the man/
directory as test cases and compare their outcome to those from previous package versions)I assume that these are the basic testing functionalities provided by devtools
and testthat
. If you expect to develop multiple packages and want to stay independent from non-base-R, I'd recommed to automate the above processes with custom scripts/packages.
I'd recomment looking into http://r-pkgs.had.co.nz/tests.html.