Skip to content

Commit

Permalink
Update to covr 3.6.3 (#23)
Browse files Browse the repository at this point in the history
* Adjusted DESCRIPTION and NEWS.md
* Different condition to skip tests
* Bump version for release

---------

Co-authored-by: Jim Hester <[email protected]>
  • Loading branch information
radbasa and jimhester authored Oct 11, 2023
1 parent 1426c5b commit 2238519
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion 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: 3.6.2.9001
Version: 3.6.3.9001
Authors@R: c(
person("Jim", "Hester", email = "[email protected]", role = c("aut", "cre")),
person("Willem", "Ligtenberg", role = "ctb"),
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

* Added support for `klmr/box` modules. This works best with `file_coverage()`. (@radbasa, #491)

# covr 3.6.3

* Updates to internal usage of `is.atomic()` to work with upcoming R release (@mmaechler , #542)

* `package_coverage()` now works correctly with ignore files when it is not run in the package root directory (@mpadge, #538)

# covr 3.6.2

# covr 3.6.1
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This is a patch release to fix a test which assumed R is on the PATH, and that it is the same R being used to check.
This is a patch release to fix a change made in R-devel

## R CMD check results
There were no NOTEs, ERRORs or WARNINGs.
5 changes: 5 additions & 0 deletions tests/testthat/helper.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
is_r_devel <- function() {
startsWith(R.version$status, "Under development")
}

is_win_r41 <- function() {
x <- getRversion()
is_windows() && x$major == 4 && x$minor == 1
}
8 changes: 4 additions & 4 deletions tests/testthat/test-Compiled.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
context("Compiled")
test_that("Compiled code coverage is reported including code in headers", {
skip_on_cran()
skip_if(is_windows() && getRversion() == "4.1")
skip_if(is_win_r41())

cov <- as.data.frame(package_coverage("TestCompiled", relative_path = TRUE))

Expand Down Expand Up @@ -34,7 +34,7 @@ test_that("Compiled code coverage is reported including code in headers", {

test_that("Can pass path to relative_path argument", {
skip_on_cran()
skip_if(is_windows() && getRversion() == "4.1")
skip_if(is_win_r41())
cov <- as.data.frame(package_coverage("TestCompiled", relative_path = "."))

expect_true(all(unique(cov$filename) %in% c(
Expand All @@ -47,7 +47,7 @@ test_that("Can pass path to relative_path argument", {

test_that("Source code subdirectories are found", {
skip_on_cran()
skip_if(is_windows() && getRversion() == "4.1")
skip_if(is_win_r41())
cov <- as.data.frame(package_coverage("TestCompiledSubdir", relative_path = TRUE))

expect_equal(cov[cov$first_line == "9", "value"], 4)
Expand All @@ -63,7 +63,7 @@ test_that("Source code subdirectories are found", {

test_that("Compiled code coverage is reported under non-standard char's", {
skip_on_cran()
skip_if(is_windows() && getRversion() == "4.1")
skip_if(is_win_r41())
cov <- as.data.frame(package_coverage("Test+Char/TestCompiled", relative_path = TRUE))

expect_equal(cov[cov$first_line == "9", "value"], 4)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-tally_coverage.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_that("tally_coverage includes compiled code", {
skip_on_cran()
skip_if(is_windows() && getRversion() == "4.1")
skip_if(is_win_r41())

cov <- package_coverage(test_path("TestCompiled"))
tall <- tally_coverage(cov)
Expand Down

0 comments on commit 2238519

Please sign in to comment.