devtools comes with some simple packages for testing. This function returns the path to them.
pkgtest(package)
package
Name of the test package.
Run examples
if (has_tests()) { pkgtest("testData") }