Skip to content

Commit bf70a52

Browse files
authored
Tweak coverage (#1435)
* Add #nocov tags to R/* files * Add #nocov tags to inst/include/Rcpp/* files * Add #nocov tags to src/* files * Tweak codecov setup too
1 parent c795586 commit bf70a52

26 files changed

+105
-87
lines changed

.codecov.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
comment: false
2+
23
coverage:
34
status:
45
project:
@@ -9,6 +10,9 @@ coverage:
910
default:
1011
target: 0% # the (on purpose low) required coverage value
1112

13+
ignore:
14+
- 'R/inline.R' # function factory setup confuses codecov
15+
1216
# layout: "header, diff, tree, changes"
1317
# behavior: default
1418
# require_changes: false # if true: only post the comment if coverage changes

ChangeLog

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
2026-01-01 Dirk Eddelbuettel <[email protected]>
2+
3+
* R/Attributes.R: Additional or adjusted #nocov tags
4+
* R/Rcpp.package.skeleton.R: Idem
5+
* R/RcppLdpath.R: Idem
6+
* R/asis.R: Idem
7+
* R/inline.R: Idem
8+
* inst/include/Rcpp/api/meat/Rcpp_eval.h: Idem
9+
* inst/include/Rcpp/internal/caster.h: Idem
10+
* inst/include/Rcpp/internal/export.h: Idem
11+
* inst/include/Rcpp/proxy/NamesProxy.h: Idem
12+
* inst/include/Rcpp/proxy/SlotProxy.h: Idem
13+
* inst/include/Rcpp/vector/Vector.h: Idem
14+
* inst/include/Rcpp/vector/proxy.h: Idem
15+
* inst/include/Rcpp/vector/traits.h: Idem
16+
* inst/include/Rcpp/Environment.h: Idem
17+
* inst/include/Rcpp/Function.h: Idem
18+
* inst/include/Rcpp/Module.h: Idem
19+
* inst/include/Rcpp/S4.h: Idem
20+
* inst/include/Rcpp/as.h: Idem
21+
* inst/include/Rcpp/exceptions.h: Idem
22+
* inst/include/Rcpp/r_cast.h: Idem
23+
* src/attributes.cpp: Idem
24+
* src/barrier.cpp: Idem
25+
126
2025-12-30 Dirk Eddelbuettel <[email protected]>
227

328
* tests/tinytest.R: Refine decision of when not to run all tests even

R/Attributes.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# Copyright (C) 2012 - 2022 JJ Allaire, Dirk Eddelbuettel and Romain Francois
3-
# Copyright (C) 2023 - 2024 JJ Allaire, Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
3+
# Copyright (C) 2023 - 2026 JJ Allaire, Dirk Eddelbuettel, Romain Francois and Iñaki Ucar
44
#
55
# This file is part of Rcpp.
66
#
@@ -571,7 +571,7 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) {
571571
}
572572

573573
.openmpPluginDefault <- function() {
574-
list(env = list(PKG_CXXFLAGS = "-fopenmp", PKG_LIBS = "-fopenmp"))
574+
list(env = list(PKG_CXXFLAGS = "-fopenmp", PKG_LIBS = "-fopenmp")) # #nocov start
575575
}
576576

577577
.openmpPluginDarwin <- function() {
@@ -629,7 +629,7 @@ compileAttributes <- function(pkgdir = ".", verbose = getOption("verbose")) {
629629
libs <- "-fopenmp"
630630
}
631631

632-
list(env = list(PKG_CXXFLAGS = cxxflags, PKG_LIBS = libs))
632+
list(env = list(PKG_CXXFLAGS = cxxflags, PKG_LIBS = libs)) # #nocov end
633633

634634
}
635635

R/Module.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2010 - 2021 John Chambers, Dirk Eddelbuettel and Romain Francois
1+
# Copyright (C) 2010 - 2026 John Chambers, Dirk Eddelbuettel and Romain Francois
22
#
33
# This file is part of Rcpp.
44
#

R/Rcpp.package.skeleton.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2009 - 2025 Dirk Eddelbuettel and Romain Francois
1+
# Copyright (C) 2009 - 2026 Dirk Eddelbuettel and Romain Francois
22
#
33
# This file is part of Rcpp.
44
#
@@ -93,7 +93,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
9393
email))
9494
fields_written <- c("Package", "Type", "Title", "Version", "Date",
9595
"Authors@R", "Description", "License", "Imports", "LinkingTo")
96-
if (!is.na(githubuser)) {
96+
if (!is.na(githubuser)) { # #nocov start
9797
x <- cbind(x, matrix("", 1, 1, dimnames=list("", "URL")))
9898
x[1, "URL"] <- paste0("https://github.com/", githubuser, "/", name)
9999
x <- cbind(x, matrix("", 1, 1, dimnames=list("", "BugReports")))
@@ -102,7 +102,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
102102
fields_written <- c("Package", "Type", "Title", "Version", "Date",
103103
"Authors@R", "Description", "URL", "BugReports",
104104
"License", "Imports", "LinkingTo")
105-
}
105+
} # #nocov end
106106

107107
x[, "License"] <- license
108108
x[, "Title"] <- "Concise Summary of What the Package Does"
@@ -136,7 +136,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
136136

137137
## update the package description help page
138138
if (havePkgKitten) { # if pkgKitten is available, use it
139-
pkgKitten::playWithPerPackageHelpPage(name, path, maintainer, email)
139+
pkgKitten::playWithPerPackageHelpPage(name, path, maintainer, email) # #nocov
140140
} else {
141141
.playWithPerPackageHelpPage(name, path, maintainer, email) # #nocov
142142
}

R/RcppLdpath.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2010 - 2021 Dirk Eddelbuettel and Romain Francois
1+
# Copyright (C) 2010 - 2026 Dirk Eddelbuettel and Romain Francois
22
#
33
# This file is part of Rcpp.
44
#
@@ -25,7 +25,7 @@ Rcpp.quoteNonStandard <- function(path) {
2525
## On unix, check if path has only characters that do not need quoting
2626
noquote <- .Platform$OS.type == "unix" && grepl("^[[:alnum:]/._~+@%-]*$", path)
2727
## If no quoting needed return unchanged else quote input
28-
if (noquote) path else shQuote(path)
28+
if (noquote) path else shQuote(path) # #nocov
2929
}
3030

3131
## Use R's internal knowledge of path settings to find the lib/ directory
@@ -66,11 +66,11 @@ RcppCxxFlags <- function(cxx0x=FALSE) {
6666

6767
## Shorter names, and call cat() directly
6868
## CxxFlags defaults to no using c++0x extensions are these are considered non-portable
69-
CxxFlags <- function(cxx0x=FALSE) {
69+
CxxFlags <- function(cxx0x=FALSE) { # #nocov start
7070
#.Deprecated(msg=paste("This function is now deprecated as R uses minimally",
7171
# "viable compilers om all platforme."))
7272
message("'CxxFlags' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.")
73-
cat(RcppCxxFlags(cxx0x=cxx0x)) # #nocov
73+
cat(RcppCxxFlags(cxx0x=cxx0x)) # #nocov end
7474
}
7575

7676
## LdFlags defaults to static linking on the non-Linux platforms Windows and OS X
@@ -84,11 +84,11 @@ RcppCapabilities <- capabilities <- function() .Call( rcpp_capabilities )
8484

8585
# compile, load and call the cxx0x.c script to identify whether
8686
# the compiler is GCC >= 4.3
87-
RcppCxx0xFlags <- function() {
87+
RcppCxx0xFlags <- function() { # #nocov start
8888
#.Deprecated(msg=paste("This function is now deprecated as R uses minimally",
8989
# "viable compilers om all platforme."))
9090
message("'RcppCxx0xFlags' has not been needed since 2013 (!!) and may get removed in 2027. Please update your 'Makevars'.")
91-
script <- Rcpp.system.file( "discovery", "cxx0x.R" ) # #nocov start
91+
script <- Rcpp.system.file( "discovery", "cxx0x.R" )
9292
flag <- capture.output( source( script ) )
9393
flag
9494
}

R/asis.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
##' # %\VignettePackage{Rcpp}
3131
##' # %\VignetteEncoding{UTF-8}
3232
##' # %\VignetteEngine{Rcpp::asis}
33-
asisWeave <- function (file, ...) {
33+
asisWeave <- function (file, ...) { # #nocov start
3434
output <- tools::file_path_sans_ext(basename(file))
3535
if (!file.exists(output)) {
3636
outputS <- file.path("..", "inst", "doc", output)
@@ -53,4 +53,4 @@ asisTangle <- function (file, ..., pattern = "(|[.][^.]*)[.]asis$") {
5353
filenameR <- sprintf("%s.R", fullname)
5454
cat(sprintf("### This is an R script tangled from '%s'\n", filename), file = filenameR)
5555
invisible(filenameR)
56-
}
56+
} # #nocov end

R/inline.R

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2009 - 2017 Dirk Eddelbuettel and Romain Francois
1+
# Copyright (C) 2009 - 2026 Dirk Eddelbuettel and Romain Francois
22
#
33
# This file is part of Rcpp.
44
#
@@ -38,12 +38,11 @@ Rcpp.plugin.maker <- function(include.before = "",
3838
#endif
3939
4040
using namespace Rcpp;", include.before, include.after)
41-
4241
out <- list(env = list( PKG_LIBS = libs ),
4342
includes = includes,
4443
LinkingTo = LinkingTo ,
4544
body = function( x ) {
46-
sprintf( "BEGIN_RCPP\n%s\nEND_RCPP", x )
45+
sprintf( "BEGIN_RCPP\n%s\nEND_RCPP", x ) # #nocov
4746
},
4847
Depends = Depends,
4948
Imports = Imports)
@@ -54,4 +53,3 @@ using namespace Rcpp;", include.before, include.after)
5453
}
5554

5655
inlineCxxPlugin <- Rcpp.plugin.maker()
57-

R/loadModule.R

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2010 - 2015 John Chambers, Dirk Eddelbuettel and Romain Francois
1+
# Copyright (C) 2010 - 2026 John Chambers, Dirk Eddelbuettel and Romain Francois
22
#
33
# This file is part of Rcpp.
44
#
@@ -54,12 +54,12 @@ loadModule <- function( module, what = character(), loadNow,
5454
if(exists(metaName, envir = env, inherits = FALSE))
5555
loadM <- get(metaName, envir = env)
5656
}
57-
else if(is(module, "Module")) {
58-
loadM <- as.environment(module) # #nocov
59-
module <- get(loadM, "moduleName") # #nocov
57+
else if(is(module, "Module")) { # #nocov start
58+
loadM <- as.environment(module)
59+
module <- get(loadM, "moduleName")
6060
}
6161
else
62-
stop(gettextf("Argument \"module\" should be a module or the name of a module: got an object of class \"%s\"", class(module)))
62+
stop(gettextf("Argument \"module\" should be a module or the name of a module: got an object of class \"%s\"", class(module))) # #nocov end
6363
if(missing(loadNow)) { # test it
6464
if(is.null(loadM))
6565
loadM <- tryCatch(Module( module, mustStart = TRUE, where = env ),
@@ -104,7 +104,7 @@ loadModule <- function( module, what = character(), loadNow,
104104
assignAs <- .moduleNames(what)
105105
for( i in seq_along(what) ) {
106106
if(.botched)
107-
assign(assignAs[[i]], NULL, envir = storage)
107+
assign(assignAs[[i]], NULL, envir = storage) # #nocov
108108
else
109109
assign(assignAs[[i]], get(what[[i]], envir = storage), envir = env)
110110
}
@@ -120,4 +120,3 @@ loadModule <- function( module, what = character(), loadNow,
120120
invisible(myCall) # #nocov
121121
}
122122
}
123-

inst/include/Rcpp/Environment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ namespace Rcpp{
106106

107107
/* We need to evaluate if it is a promise */
108108
if( TYPEOF(res) == PROMSXP){
109-
res = internal::Rcpp_eval_impl( res, env ) ;
109+
res = internal::Rcpp_eval_impl( res, env ) ; // #nocov
110110
}
111111
return res ;
112112
}

0 commit comments

Comments
 (0)