1- # Copyright (C) 2009 - 2020 Dirk Eddelbuettel and Romain Francois
1+ # Copyright (C) 2009 - 2021 Dirk Eddelbuettel and Romain Francois
22#
33# This file is part of Rcpp.
44#
@@ -33,7 +33,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
3333 env <- parent.frame(1 )
3434
3535 if (! is.character(cpp_files ))
36- stop(" 'cpp_files' must be a character vector" )
36+ stop(" 'cpp_files' must be a character vector" ) # #nocov
3737
3838 if (! length(list )) {
3939 fake <- TRUE
@@ -46,12 +46,12 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
4646 }
4747 } else {
4848 if (example_code && ! isTRUE(attributes )) {
49- if (! " rcpp_hello_world" %in% list ) {
49+ if (! " rcpp_hello_world" %in% list ) { # #nocov start
5050 assign( " rcpp_hello_world" , function () {}, envir = env )
5151 call [[" list" ]] <- as.call(c(as.name(" c" ),
5252 as.list(c(" rcpp_hello_world" , list ))))
5353 }
54- remove_hello_world <- TRUE
54+ remove_hello_world <- TRUE # #nocov end
5555 } else {
5656 remove_hello_world <- FALSE
5757 }
@@ -69,7 +69,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
6969 }
7070
7171 tryCatch(eval(call , envir = env ), error = function (e ){
72- stop(sprintf(" error while calling `package.skeleton` : %s" , conditionMessage(e )))
72+ stop(sprintf(" error while calling `package.skeleton` : %s" , conditionMessage(e ))) # #nocov
7373 })
7474
7575 message(" \n Adding Rcpp settings" )
@@ -103,7 +103,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
103103 if (getRversion() > = " 3.4.0" ) {
104104 lines <- c(sprintf( " useDynLib(%s, .registration=TRUE)" , name ), lines )
105105 } else {
106- lines <- c(sprintf( " useDynLib(%s)" , name ), lines )
106+ lines <- c(sprintf( " useDynLib(%s)" , name ), lines ) # #nocov
107107 }
108108 writeLines(lines , con = ns )
109109 message(" >> added useDynLib directive to NAMESPACE" )
@@ -124,7 +124,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
124124 if (havePkgKitten ) { # if pkgKitten is available, use it
125125 pkgKitten :: playWithPerPackageHelpPage(name , path , maintainer , email )
126126 } else {
127- .playWithPerPackageHelpPage(name , path , maintainer , email )
127+ .playWithPerPackageHelpPage(name , path , maintainer , email ) # #nocov
128128 }
129129
130130 # # lay things out in the src directory
@@ -135,9 +135,9 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
135135 skeleton <- system.file(" skeleton" , package = " Rcpp" )
136136
137137 if (length(cpp_files ) > 0L ) {
138- for (file in cpp_files ) {
138+ for (file in cpp_files ) { # #nocov start
139139 file.copy(file , src )
140- message(" >> copied " , file , " to src directory" )
140+ message(" >> copied " , file , " to src directory" ) # #nocov end
141141 }
142142 }
143143
@@ -190,7 +190,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
190190 close(con )
191191 message(" >> created init.c for package registration" )
192192 } else {
193- message(" >> R version older than 3.4.0 detected, so NO file init.c created." )
193+ message(" >> R version older than 3.4.0 detected, so NO file init.c created." ) # #nocov
194194 }
195195 }
196196
@@ -232,7 +232,7 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
232232 path = " ." ,
233233 maintainer = " Your Name" ,
234234 email = " your@mail.com" ) {
235- root <- file.path(path , name )
235+ root <- file.path(path , name ) # #nocov start
236236 helptgt <- file.path(root , " man" , sprintf( " %s-package.Rd" , name ))
237237 helpsrc <- system.file(" skeleton" , " manual-page-stub.Rd" , package = " Rcpp" )
238238 # # update the package description help page
@@ -244,5 +244,5 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
244244 lines , fixed = TRUE )
245245 writeLines(lines , helptgt )
246246 }
247- invisible (NULL )
247+ invisible (NULL ) # #nocov end
248248}
0 commit comments