Skip to content

Commit

Permalink
Merge branch '3.3.0-rc'
Browse files Browse the repository at this point in the history
  • Loading branch information
jimhester committed Jun 26, 2017
2 parents 45b85d6 + f49e64e commit 8a9f7da
Show file tree
Hide file tree
Showing 13 changed files with 2,563 additions and 521 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Encoding: UTF-8
Package: covr
Title: Test Coverage for Packages
Version: 2.2.2.9000
Version: 3.0.0
Authors@R: c(
person("Jim", "Hester", email = "[email protected]", role = c("aut", "cre")),
person("Willem", "Ligtenberg", role = "ctb"),
Expand All @@ -26,8 +26,8 @@ Authors@R: c(
person("David", "Hugh-Jones", role = "ctb"),
person("Qin", "Wang", role = "ctb"))
Description: Track and report code coverage for your package and (optionally)
upload the results to a coverage service like 'Codecov' (http://codecov.io) or
'Coveralls' (http://coveralls.io). Code coverage is a measure of the amount of
upload the results to a coverage service like 'Codecov' <http://codecov.io> or
'Coveralls' <http://coveralls.io>. Code coverage is a measure of the amount of
code being exercised by a set of tests. It is an indirect measure of test
quality and completeness. This package is compatible with any testing
methodology or framework and tracks coverage of both R code and compiled
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ build-docker-checker:

run-rocker: build-docker-checker
-docker rm $(RCHECKER)
docker run --rm -ti -v $(PWD)/..:/home/docker $(RCHECKER) bash
docker run --rm -ti -v $(PWD)/..:/home/docker $(RCHECKER) bash

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


rox: build-docker-checker
docker run --rm -ti -v $(PWD)/..:/home/docker $(RCHECKER) Rscript -e 'devtools::document("covr")'
docker run --rm -ti -v $(PWD)/..:/home/docker $(RCHECKER) Rscript -e 'devtools::document("covr")'
3 changes: 1 addition & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ importFrom(utils,getSrcFilename)
importFrom(utils,head)
importFrom(utils,relist)
importFrom(utils,str)
useDynLib(covr,covr_duplicate_)
useDynLib(covr,covr_reassign_function)
useDynLib(covr, .registration = TRUE)
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## 2.2.2-9000 ##
## 3.0.0 ##
* The covr license has been changed to GPL-3.
* Set environment variable `R_COVR=true` when covr is running (#236, #268).
* Made the gather-and-merge-results step at the end of package_coverage() more memory efficient (#226, @HenrikBengtsson).
* Support code coverage with icc (#247, @QinWang).

Expand Down
9 changes: 5 additions & 4 deletions R/covr.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ package_coverage <- function(path = ".",
stop("icc is not available")
}
}

if (isTRUE(clean)) {
on.exit({
clean_objects(pkg$path)
Expand Down Expand Up @@ -269,7 +269,8 @@ package_coverage <- function(path = ".",
c(R_DEFAULT_PACKAGES = "datasets,utils,grDevices,graphics,stats,methods",
R_LIBS = libs,
R_LIBS_USER = libs,
R_LIBS_SITE = libs), {
R_LIBS_SITE = libs,
R_COVR = "true"), {


withCallingHandlers({
Expand Down Expand Up @@ -313,7 +314,7 @@ package_coverage <- function(path = ".",
} else {
res <- run_icov(pkg$path, quiet = quiet)
}

coverage <- structure(c(coverage, res),
class = "coverage",
package = pkg,
Expand Down Expand Up @@ -364,7 +365,7 @@ merge_coverage <- function(files) {
}
y <- NULL
}

x
}

Expand Down
10 changes: 5 additions & 5 deletions R/icc.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ parse_icov <- function(lines, package_path = "") {
nums <- c(idx1[2L:length(idx1)]-1L, length(r1)) - idx1
stopifnot(sum(nums) == nrow(m1))
m1$functions <- unlist(mapply(rep, r1[idx1], nums,
SIMPLIFY=FALSE, USE.NAMES=FALSE))
SIMPLIFY=FALSE, USE.NAMES=FALSE))
}
}
}
Expand Down Expand Up @@ -65,7 +65,7 @@ parse_icov <- function(lines, package_path = "") {
run_icov <- function(path, quiet = TRUE,
icov_path = getOption("covr.icov", ""),
icov_args = getOption("covr.icov_args", NULL)) {

src_path <- normalize_path(file.path(path, "src"))
if (!file.exists(src_path)) {
return()
Expand All @@ -85,7 +85,7 @@ run_icov <- function(path, quiet = TRUE,
icov_inputs <- list.files(path, pattern = rex::rex(".dyn", end),
recursive = TRUE, full.names = TRUE)
if (length(icov_inputs) == 0L) {
warning("no icc .dyn files are generated")
warning("no icc .dyn files are generated")
return()
}

Expand All @@ -97,11 +97,11 @@ run_icov <- function(path, quiet = TRUE,
system_check(icov_path,
args = c("-prj", "tmp", "-spi", file.path(src_path, "pgopti.spi"),
"-dpi", file.path(src_path, "pgopti.dpi"),
"-include-nonexec",
"-include-nonexec",
"-txtbcvrg", "bcovg.log"),
quiet = quiet, echo = !quiet)
})

lines <- readLines(file.path(src_path, "bcovg.log"))

# generate line coverage
Expand Down
4 changes: 1 addition & 3 deletions R/replace.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @useDynLib covr covr_duplicate_
#' @useDynLib covr, .registration = TRUE
replacement <- function(name, env = as.environment(-1), target_value = get(name, envir = env)) {
if (is.function(target_value) && !is.primitive(target_value)) {
if (is_vectorized(target_value)) {
Expand Down Expand Up @@ -26,12 +26,10 @@ replacement <- function(name, env = as.environment(-1), target_value = get(name,
}
}

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

#' @useDynLib covr covr_reassign_function
reset <- function(replacement) {
.Call(covr_reassign_function, replacement$name, replacement$env, replacement$target_value, replacement$orig_value)
}
15 changes: 11 additions & 4 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This release fixes a test error when run with the soon to be submitted xml2
1.1.0 release.
This release changes the package license from MIT to GPL-3. I obtained approval
from all contributors <https://github.com/jimhester/covr/issues/256> for the license change.

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

Covr is a development tool only so its code is not actually run when building
any downstream dependencies. Nonetheless I have run R CMD check on the 151
downstream dependencies. There were no relevant Errors.
any downstream dependencies. Nonetheless I have run R CMD check on the 262
downstream dependencies.

The errors in biolink, geofacet, Wmisc are due to `lintr::expect_lint_free()`
not working properly when it is used while running `devtools::revdep_check()`.
I opened issue [#251](https://github.com/jimhester/lintr/issues/251) to track
this bug in lintr.

I did not see any other errors that were relevant to the covr changes.

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

0 comments on commit 8a9f7da

Please sign in to comment.