Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
comment: false
comment:
layout: "header, diff, tree, changes"
behavior: default
require_changes: false # if true: only post the comment if coverage changes
branches: null
flags: null
paths: null
13 changes: 13 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
2016-12-04 Dirk Eddelbuettel <edd@debian.org>

* .codecov.yml (comment): Enable more verbose codecov.io reports

2016-12-03 Dirk Eddelbuettel <edd@debian.org>

* inst/unitTests/cpp/dates.cpp (Datetime_format): Additional ostream tests
* inst/unitTests/runit.Date.R (test.Date.formating): Ditto

* inst/unitTests/runit.system.R (test.RcppCxx): New tests

* R/RcppLdpath.R (canUseCXX0X): Simplified as we can now rely on more
modern compilers; underlying C++ code has not been present for a while

* R/compilerCheck.R (compilerCheck): Added some #nocov tags
* R/unit.tests.R (test, gctortureRUnitTest): Ditto
* R/zzz.R (.onLoad): Ditto

2016-11-29 Dirk Eddelbuettel <edd@debian.org>

* DESCRIPTION (Version, Date): Roll minor version to 0.12.8.2
Expand Down
2 changes: 1 addition & 1 deletion R/RcppLdpath.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RcppLdPath <- function() {
RcppLdFlags <- function() { "" }

# indicates if Rcpp was compiled with GCC >= 4.3
canUseCXX0X <- function() .Call( "canUseCXX0X", PACKAGE = "Rcpp" )
canUseCXX0X <- function() { TRUE } # .Call( "canUseCXX0X", PACKAGE = "Rcpp" )

## Provide compiler flags -- i.e. -I/path/to/Rcpp.h
RcppCxxFlags <- function(cxx0x=FALSE) {
Expand Down
4 changes: 2 additions & 2 deletions R/compilerCheck.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
##' @return A boolean value is returned, indicating if the minimal version is
##' being met
##' @author Dirk Eddelbuettel
compilerCheck <- function(minVersion=package_version("4.6.0")) {
compilerCheck <- function(minVersion=package_version("4.6.0")) { # nocov start

binaries <- c("g++", Sys.getenv("CXX", unset=""), Sys.getenv("CXX1X", unset=""))
binpaths <- lapply(binaries, function(b) { if (b=="") NULL else Sys.which(b) })
Expand All @@ -29,7 +29,7 @@ compilerCheck <- function(minVersion=package_version("4.6.0")) {
package_version(ver) >= minVersion
})
all(do.call(c, rl)) # drops NULLs
}
} # nocov end

## TODO: maybe not limit to gcc/g++
## TODO: maybe be smarter about combination of path, CXX and CXX1X ?
Expand Down
12 changes: 6 additions & 6 deletions R/unit.tests.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2010 - 2015 Dirk Eddelbuettel, Romain Francois and Kevin Ushey
# Copyright (C) 2010 - 2016 Dirk Eddelbuettel, Romain Francois and Kevin Ushey
#
# This file is part of Rcpp.
#
Expand All @@ -19,7 +19,7 @@ test <- function(output=if(file.exists("/tmp")) "/tmp" else getwd(),
gctorture=FALSE,
gctorture.exclude="runit.Module.client.package.R") {

if (requireNamespace("RUnit")) {
if (requireNamespace("RUnit")) { # nocov start

if (gctorture) {

Expand Down Expand Up @@ -82,7 +82,7 @@ test <- function(output=if(file.exists("/tmp")) "/tmp" else getwd(),
RUnit::printTextProtocol(tests)

return(tests)
}
} # nocov end

stop("Running unit tests requires the 'RUnit' package.")
}
Expand All @@ -101,9 +101,9 @@ unitTestSetup <- function(file, packages=NULL,

gctortureRUnitTest <- function(file) {

test <- readLines(file)
test <- readLines(file) # nocov start

## TODO: handle '{', '}' within quotes
## todo: handle '{', '}' within quotes
findMatchingBrace <- function(test, start, balance=1) {
line <- test[start]
if (start > length(test)) {
Expand Down Expand Up @@ -135,6 +135,6 @@ gctortureRUnitTest <- function(file) {
test[end] <- paste("gctorture(FALSE); }")
}

cat(test, file=file, sep="\n")
cat(test, file=file, sep="\n") # nocov end

}
4 changes: 2 additions & 2 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2009 - 2013 Dirk Eddelbuettel and Romain Francois
# Copyright (C) 2009 - 2016 Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
Expand All @@ -20,7 +20,7 @@
.classes_map <- new.env()

.onLoad <- function(libname, pkgname){
new_dummyObject(.dummyInstancePointer);
new_dummyObject(.dummyInstancePointer) # nocov
}


45 changes: 45 additions & 0 deletions inst/unitTests/runit.system.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env r
# -*- mode: R; tab-width: 4; -*-
#
# Copyright (C) 2016 Dirk Eddelbuettel
#
# This file is part of Rcpp.
#
# Rcpp is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# Rcpp is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.

.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"

if (.runThisTest) {

test.Rcpp.system.file <- function() {
inc_rcpp <- Rcpp:::Rcpp.system.file("include")
inc_sys <- tools::file_path_as_absolute( base::system.file("include", package = "Rcpp"))
checkEquals(inc_rcpp, inc_sys, msg = "Rcpp.system.file")

}

test.RcppLd <- function() {
checkTrue(Rcpp:::RcppLdPath() == "", msg = "RcppLdPath")
checkTrue(Rcpp:::RcppLdFlags() == "", msg = "RcppLdFlags")
checkEquals(Rcpp:::LdFlags(), NULL, msg = "LdFlags")
}

test.RcppCxx <- function() {
checkTrue(Rcpp:::canUseCXX0X(), msg = "canUseCXX0X")
checkTrue(Rcpp:::RcppCxxFlags() != "", msg = "RcppCxxFlags()")
checkEquals(Rcpp:::CxxFlags(), NULL, msg = "CxxFlags()")

checkTrue(length(Rcpp:::RcppCapabilities()) >= 13, msg = "RcppCapabilities()")
}
}