'Include tests in binary R package

I am using testthat to write unit tests for my R packages. I have seen a few package authors (like those from Rcpp and ggplot2) distributing their unit tests with the binary files. However, when I build my packages with RStudio (0.98.1102) and devtools (1.7.0) the tests folder is not included in the zip file. Do I have to add the folder manually or is it possible to get this done automatically by setting some option?

BTW: I am on a Win7 machine using R v3.1.2 and RTools v3.1.0.1942.



Solution 1:[1]

On Windows, you need code like

install.packages("dwdradar", INSTALL_opts = "--install-tests", type="source")

Without the type option, the test folder is not installed.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Berry Boessenkool