Skip to content

Commit 8a9f7da

Browse files
committed
Merge branch '3.3.0-rc'
2 parents 45b85d6 + f49e64e commit 8a9f7da

File tree

13 files changed

+2563
-521
lines changed

13 files changed

+2563
-521
lines changed

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Encoding: UTF-8
22
Package: covr
33
Title: Test Coverage for Packages
4-
Version: 2.2.2.9000
4+
Version: 3.0.0
55
Authors@R: c(
66
person("Jim", "Hester", email = "[email protected]", role = c("aut", "cre")),
77
person("Willem", "Ligtenberg", role = "ctb"),
@@ -26,8 +26,8 @@ Authors@R: c(
2626
person("David", "Hugh-Jones", role = "ctb"),
2727
person("Qin", "Wang", role = "ctb"))
2828
Description: Track and report code coverage for your package and (optionally)
29-
upload the results to a coverage service like 'Codecov' (http://codecov.io) or
30-
'Coveralls' (http://coveralls.io). Code coverage is a measure of the amount of
29+
upload the results to a coverage service like 'Codecov' <http://codecov.io> or
30+
'Coveralls' <http://coveralls.io>. Code coverage is a measure of the amount of
3131
code being exercised by a set of tests. It is an indirect measure of test
3232
quality and completeness. This package is compatible with any testing
3333
methodology or framework and tracks coverage of both R code and compiled

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ build-docker-checker:
1313

1414
run-rocker: build-docker-checker
1515
-docker rm $(RCHECKER)
16-
docker run --rm -ti -v $(PWD)/..:/home/docker $(RCHECKER) bash
16+
docker run --rm -ti -v $(PWD)/..:/home/docker $(RCHECKER) bash
1717

1818
test: build-docker-checker fix-permission-tests
1919
docker run --rm -ti -v $(PWD)/..:/home/docker $(RCHECKER) Rscript -e 'library(devtools);install("covr");test("covr", "$(FILTER)")'
@@ -24,4 +24,4 @@ check: build-docker-checker fix-permission-tests
2424

2525

2626
rox: build-docker-checker
27-
docker run --rm -ti -v $(PWD)/..:/home/docker $(RCHECKER) Rscript -e 'devtools::document("covr")'
27+
docker run --rm -ti -v $(PWD)/..:/home/docker $(RCHECKER) Rscript -e 'devtools::document("covr")'

NAMESPACE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,4 @@ importFrom(utils,getSrcFilename)
3131
importFrom(utils,head)
3232
importFrom(utils,relist)
3333
importFrom(utils,str)
34-
useDynLib(covr,covr_duplicate_)
35-
useDynLib(covr,covr_reassign_function)
34+
useDynLib(covr, .registration = TRUE)

NEWS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
## 2.2.2-9000 ##
1+
## 3.0.0 ##
2+
* The covr license has been changed to GPL-3.
3+
* Set environment variable `R_COVR=true` when covr is running (#236, #268).
24
* Made the gather-and-merge-results step at the end of package_coverage() more memory efficient (#226, @HenrikBengtsson).
35
* Support code coverage with icc (#247, @QinWang).
46

R/covr.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ package_coverage <- function(path = ".",
236236
stop("icc is not available")
237237
}
238238
}
239-
239+
240240
if (isTRUE(clean)) {
241241
on.exit({
242242
clean_objects(pkg$path)
@@ -269,7 +269,8 @@ package_coverage <- function(path = ".",
269269
c(R_DEFAULT_PACKAGES = "datasets,utils,grDevices,graphics,stats,methods",
270270
R_LIBS = libs,
271271
R_LIBS_USER = libs,
272-
R_LIBS_SITE = libs), {
272+
R_LIBS_SITE = libs,
273+
R_COVR = "true"), {
273274

274275

275276
withCallingHandlers({
@@ -313,7 +314,7 @@ package_coverage <- function(path = ".",
313314
} else {
314315
res <- run_icov(pkg$path, quiet = quiet)
315316
}
316-
317+
317318
coverage <- structure(c(coverage, res),
318319
class = "coverage",
319320
package = pkg,
@@ -364,7 +365,7 @@ merge_coverage <- function(files) {
364365
}
365366
y <- NULL
366367
}
367-
368+
368369
x
369370
}
370371

R/icc.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ parse_icov <- function(lines, package_path = "") {
3737
nums <- c(idx1[2L:length(idx1)]-1L, length(r1)) - idx1
3838
stopifnot(sum(nums) == nrow(m1))
3939
m1$functions <- unlist(mapply(rep, r1[idx1], nums,
40-
SIMPLIFY=FALSE, USE.NAMES=FALSE))
40+
SIMPLIFY=FALSE, USE.NAMES=FALSE))
4141
}
4242
}
4343
}
@@ -65,7 +65,7 @@ parse_icov <- function(lines, package_path = "") {
6565
run_icov <- function(path, quiet = TRUE,
6666
icov_path = getOption("covr.icov", ""),
6767
icov_args = getOption("covr.icov_args", NULL)) {
68-
68+
6969
src_path <- normalize_path(file.path(path, "src"))
7070
if (!file.exists(src_path)) {
7171
return()
@@ -85,7 +85,7 @@ run_icov <- function(path, quiet = TRUE,
8585
icov_inputs <- list.files(path, pattern = rex::rex(".dyn", end),
8686
recursive = TRUE, full.names = TRUE)
8787
if (length(icov_inputs) == 0L) {
88-
warning("no icc .dyn files are generated")
88+
warning("no icc .dyn files are generated")
8989
return()
9090
}
9191

@@ -97,11 +97,11 @@ run_icov <- function(path, quiet = TRUE,
9797
system_check(icov_path,
9898
args = c("-prj", "tmp", "-spi", file.path(src_path, "pgopti.spi"),
9999
"-dpi", file.path(src_path, "pgopti.dpi"),
100-
"-include-nonexec",
100+
"-include-nonexec",
101101
"-txtbcvrg", "bcovg.log"),
102102
quiet = quiet, echo = !quiet)
103103
})
104-
104+
105105
lines <- readLines(file.path(src_path, "bcovg.log"))
106106

107107
# generate line coverage

R/replace.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' @useDynLib covr covr_duplicate_
1+
#' @useDynLib covr, .registration = TRUE
22
replacement <- function(name, env = as.environment(-1), target_value = get(name, envir = env)) {
33
if (is.function(target_value) && !is.primitive(target_value)) {
44
if (is_vectorized(target_value)) {
@@ -26,12 +26,10 @@ replacement <- function(name, env = as.environment(-1), target_value = get(name,
2626
}
2727
}
2828

29-
#' @useDynLib covr covr_reassign_function
3029
replace <- function(replacement) {
3130
.Call(covr_reassign_function, replacement$name, replacement$env, replacement$target_value, replacement$new_value)
3231
}
3332

34-
#' @useDynLib covr covr_reassign_function
3533
reset <- function(replacement) {
3634
.Call(covr_reassign_function, replacement$name, replacement$env, replacement$target_value, replacement$orig_value)
3735
}

cran-comments.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
This release fixes a test error when run with the soon to be submitted xml2
2-
1.1.0 release.
1+
This release changes the package license from MIT to GPL-3. I obtained approval
2+
from all contributors <https://github.com/jimhester/covr/issues/256> for the license change.
33

44
## Test environments
55
* OS X El Capitan, R 3.3.0
@@ -17,7 +17,14 @@ There were no NOTEs, ERRORs or WARNINGs.
1717
## Reverse dependencies
1818

1919
Covr is a development tool only so its code is not actually run when building
20-
any downstream dependencies. Nonetheless I have run R CMD check on the 151
21-
downstream dependencies. There were no relevant Errors.
20+
any downstream dependencies. Nonetheless I have run R CMD check on the 262
21+
downstream dependencies.
22+
23+
The errors in biolink, geofacet, Wmisc are due to `lintr::expect_lint_free()`
24+
not working properly when it is used while running `devtools::revdep_check()`.
25+
I opened issue [#251](https://github.com/jimhester/lintr/issues/251) to track
26+
this bug in lintr.
27+
28+
I did not see any other errors that were relevant to the covr changes.
2229

2330
Summary at: https://github.com/jimhester/covr/tree/master/revdep

0 commit comments

Comments
 (0)