Skip to content

Commit ddbfbec

Browse files
committed
Set R_TESTS to improve consistency with R CMD check
R CMD check sets this environment variable when running tests, but tools::testInstalledPackage does not. Covr aims to be as consistent as possible with R CMD check, so we should set it as well. Fixes #420
1 parent fa51f4f commit ddbfbec

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# covr (development version)
22

3+
* `package_coverage()` now sets the environment variable `R_TESTS` to the tests-startup.R file like R CMD check does (#420)
4+
35
* `codecov()` is now more robust when `coverage` is not the output from `package_coverage()` and `token` is not provided (#456)
46
* `as.data.frame()` now returns an 0 row data frame when there are no functions in a package (#427)
57

R/covr.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ package_coverage <- function(path = ".",
336336
R_LIBS = libs,
337337
R_LIBS_USER = libs,
338338
R_LIBS_SITE = libs,
339-
R_COVR = "true"), {
339+
R_COVR = "true",
340+
R_TESTS = file.path(R.home("share"), "R", "tests-startup.R")), {
340341

341342

342343
withCallingHandlers({

0 commit comments

Comments
 (0)