Skip to content

Commit 8e3076d

Browse files
committed
added #nocov tags for files unlikely to get tests
1 parent 2985fad commit 8e3076d

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2016-12-10 Dirk Eddelbuettel <[email protected]>
2+
3+
* R/loadRcppModules.R: Added #nocov tags
4+
* R/loadModule.R: Ditto
5+
6+
* R/unit.tests.R (test): Adjusted one #nocov tag
7+
18
2016-12-09 Dirk Eddelbuettel <[email protected]>
29

310
* R/00_classes.R: Added #nocov tags

R/loadModule.R

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ isBotchedSession <- function()
2828
assignAs
2929
}
3030

31-
.DummyModule <- function(name, what) {
31+
.DummyModule <- function(name, what) { # #nocov start
3232
value <- new.env()
3333
storage <- new.env()
3434
assign("storage", storage, envir = value)
@@ -37,7 +37,7 @@ isBotchedSession <- function()
3737
for(el in allNames)
3838
assign(el, NULL, envir = storage)
3939
value
40-
}
40+
} # #nocov end
4141

4242
.moduleMetaName <- function(name)
4343
methods::methodsPackageMetaName("Mod",name)
@@ -54,9 +54,9 @@ 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)
59-
module <- get(loadM, "moduleName")
57+
else if(is(module, "Module")) {
58+
loadM <- as.environment(module) # #nocov
59+
module <- get(loadM, "moduleName") # #nocov
6060
}
6161
else
6262
stop(gettextf("Argument \"module\" should be a module or the name of a module: got an object of class \"%s\"", class(module)))
@@ -74,10 +74,10 @@ loadModule <- function( module, what = character(), loadNow,
7474
loadM <- tryCatch(Module( module, mustStart = TRUE, where = env ),
7575
error = function(e)e)
7676
if(is(loadM, "error")) {
77-
if(.botched)
77+
if(.botched) # #nocov start
7878
return(.DummyModule(module, what))
7979
stop(gettextf("Unable to load module \"%s\": %s",
80-
as(module, "character"), loadM$message))
80+
as(module, "character"), loadM$message)) # #nocov end
8181
}
8282
if(!exists(metaName, envir = env, inherits =FALSE))
8383
assign(metaName, loadM, envir = env)
@@ -90,7 +90,7 @@ loadModule <- function( module, what = character(), loadNow,
9090
what <- objects(storage)
9191
missingObjs <- !sapply(what, function(symb) exists(symb, envir = storage, inherits = FALSE))
9292
if(any(missingObjs)) {
93-
if(.botched) {
93+
if(.botched) { # #nocov start
9494
for(el in what[missingObjs])
9595
assign(el, NULL, envir = storage)
9696
}
@@ -99,7 +99,7 @@ loadModule <- function( module, what = character(), loadNow,
9999
paste0('"', what[missingObjs], '"', collapse = ", "),
100100
as.character(module)))
101101
what <- what[!missingObjs]
102-
}
102+
} # #nocov end
103103
}
104104
assignAs <- .moduleNames(what)
105105
for( i in seq_along(what) ) {
@@ -117,7 +117,7 @@ loadModule <- function( module, what = character(), loadNow,
117117
myCall$loadNow <- TRUE
118118
body(f, envir = env) <- myCall
119119
setLoadAction(f, where = env)
120-
invisible(myCall)
120+
invisible(myCall) # #nocov
121121
}
122122
}
123123

R/loadRcppModules.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2010 - 2012 John Chambers, Dirk Eddelbuettel and Romain Francois
1+
# Copyright (C) 2010 - 2016 John Chambers, Dirk Eddelbuettel and Romain Francois
22
#
33
# This file is part of Rcpp.
44
#
@@ -15,7 +15,7 @@
1515
# You should have received a copy of the GNU General Public License
1616
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
1717

18-
loadRcppModules <- function(direct=TRUE) {
18+
loadRcppModules <- function(direct=TRUE) { # #nocov start
1919
# deprecation added May 2016, 'loadModule' has been prefered for years
2020
.Deprecated("loadModule")
2121

@@ -56,4 +56,4 @@ loadRcppModules <- function(direct=TRUE) {
5656
})
5757
}
5858
}
59-
}
59+
} # #nocov end

R/unit.tests.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ test <- function(output=if(file.exists("/tmp")) "/tmp" else getwd(),
8282
RUnit::printTextProtocol(tests)
8383

8484
return(tests)
85-
} # nocov end
85+
}
8686

87-
stop("Running unit tests requires the 'RUnit' package.")
87+
stop("Running unit tests requires the 'RUnit' package.") # nocov end
8888
}
8989

9090
unitTestSetup <- function(file, packages=NULL,

0 commit comments

Comments
 (0)