Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我有tests/testhat/testhat.R,找到它并devtools::test()运行它,但没有找到它。covr:package_coverage()R CMD check
devtools::test()
covr:package_coverage()
R CMD check
如果我将其作为tests/testhat.R,devtools::test()则找不到它,但covr:package_coverage()确实找到了R CMD check。
最好的方法是什么?
R 4.0.0; 测试2.3.2;覆盖 3.5.0
您的文件夹的目录结构test应如下所示:
test
. ├── testthat │ ├── test-1.R │ ├── test-2.R │ ├── test-3.R │ ├── test-4.R │ └── test-5.R └── testthat.R
并testthat.R包含
testthat.R
library(testthat) library(mypackage) test_check("mypackage")
这适用于R CMD check和。covrdevtools::check()
covr
devtools::check()