[Rcpp-commits] r3640 - in pkg/Rcpp: . debian inst inst/doc/unitTests inst/include/Rcpp inst/unitTests src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jun 23 19:07:05 CEST 2012


Author: edd
Date: 2012-06-23 19:07:05 +0200 (Sat, 23 Jun 2012)
New Revision: 3640

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/DESCRIPTION
   pkg/Rcpp/cleanup
   pkg/Rcpp/debian/changelog
   pkg/Rcpp/inst/NEWS
   pkg/Rcpp/inst/doc/unitTests/Rcpp-unitTests.R
   pkg/Rcpp/inst/include/Rcpp/Environment.h
   pkg/Rcpp/inst/include/Rcpp/config.h
   pkg/Rcpp/inst/unitTests/runTests.R
   pkg/Rcpp/inst/unitTests/runit.Module.R
   pkg/Rcpp/inst/unitTests/runit.Module.client.package.R
   pkg/Rcpp/inst/unitTests/runit.XPTr.R
   pkg/Rcpp/inst/unitTests/runit.client.package.R
   pkg/Rcpp/inst/unitTests/runit.macros.R
   pkg/Rcpp/src/Environment.cpp
Log:
Release 0.9.12 (and ChangeLog has details)


Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2012-06-22 11:23:28 UTC (rev 3639)
+++ pkg/Rcpp/ChangeLog	2012-06-23 17:07:05 UTC (rev 3640)
@@ -1,3 +1,26 @@
+2012-06-23  Dirk Eddelbuettel  <edd at debian.org>
+
+	* src/Environment.cpp: Remove empty constructor which is redundant
+	since fix in rev3592 with default SEXP value of R_GlobalEnv
+	* inst/include/Rcpp/Environment.h: Idem 
+
+	* inst/unitTests/runTests.R (allTests): Command-line flag --allTests
+	sets an environment variable indicating that all tests should run
+
+	* inst/unitTests/runit.Module.R: Run only if RunAllCppTests var set 
+	* inst/unitTests/runit.Module.client.package.R: Idem 
+	* inst/unitTests/runit.client.package.R: Idem
+	* inst/unitTests/runit.XPtr.R: Idem
+	* inst/unitTests/runit.macros.R: Idem
+
+	* inst/doc/unitTests/Rcpp-unitTests.R: Ensure Rcpp-unitTests 
+	vignette is built with RunAllCppTests flag set
+	
+	* cleanup: Also clean in inst/unitTests/testRcppClass/src
+
+	* DESCRIPTION: Set Maintainer: to edd at debian.org as CRAN prefers to
+	receive upload email from the same address the Maintainer field
+	
 2012-06-22  Dirk Eddelbuettel  <edd at debian.org>
 
         * DESCRIPTION: Release 0.9.11
@@ -10,7 +33,7 @@
 2012-06-21  Dirk Eddelbuettel  <edd at debian.org>
 
 	* inst/doc/Rcpp-modules/Rcpp-modules.Rnw: Updated to reflect use
-	under R 2.15.1 
+	under R 2.15.1
 	* inst/skeleton/zzz.R: Idem
 
 2012-06-20  Dirk Eddelbuettel  <edd at debian.org>
@@ -19,7 +42,7 @@
 	as suggested by Kurt, and fetch libname from enclosing environment
 
 	* DESCRIPTION: Typo and grammar fixes with thanks to Kurt and Doug
-	
+
 2012-05-25  Dirk Eddelbuettel  <edd at debian.org>
 
 	* inst/skeleton/zzz.R: Added new 'evalqOnLoad()' call for R-devel,

Modified: pkg/Rcpp/DESCRIPTION
===================================================================
--- pkg/Rcpp/DESCRIPTION	2012-06-22 11:23:28 UTC (rev 3639)
+++ pkg/Rcpp/DESCRIPTION	2012-06-23 17:07:05 UTC (rev 3640)
@@ -1,10 +1,10 @@
 Package: Rcpp
 Title: Seamless R and C++ Integration
-Version: 0.9.11
+Version: 0.9.12
 Date: $Date$
 Author: Dirk Eddelbuettel and Romain Francois, with contributions 
  by Douglas Bates and John Chambers
-Maintainer: Dirk Eddelbuettel and Romain Francois <RomainAndDirk at r-enthusiasts.com>
+Maintainer: Dirk Eddelbuettel <edd at debian.org>
 Description: The Rcpp package provides R functions as well as a C++ library
  which facilitate the integration of R and C++.
  .

Modified: pkg/Rcpp/cleanup
===================================================================
--- pkg/Rcpp/cleanup	2012-06-22 11:23:28 UTC (rev 3639)
+++ pkg/Rcpp/cleanup	2012-06-23 17:07:05 UTC (rev 3640)
@@ -21,6 +21,8 @@
         inst/discovery/cxx0x.Rout \
 	inst/unitTests/testRcppModule/src/*.o \
 	inst/unitTests/testRcppModule/src/*.so \
+	inst/unitTests/testRcppClass/src/*.o \
+	inst/unitTests/testRcppClass/src/*.so \
 	src/Makedeps libRcpp.a \
 	build/Rcpp.pdf \
 	src/symbols.rds \

Modified: pkg/Rcpp/debian/changelog
===================================================================
--- pkg/Rcpp/debian/changelog	2012-06-22 11:23:28 UTC (rev 3639)
+++ pkg/Rcpp/debian/changelog	2012-06-23 17:07:05 UTC (rev 3640)
@@ -1,3 +1,9 @@
+rcpp (0.9.12-1) unstable; urgency=low
+
+  * New release
+
+ -- Dirk Eddelbuettel <edd at debian.org>  Sat, 23 Jun 2012 11:20:06 -0500
+
 rcpp (0.9.11-1) unstable; urgency=low
 
   * New release

Modified: pkg/Rcpp/inst/NEWS
===================================================================
--- pkg/Rcpp/inst/NEWS	2012-06-22 11:23:28 UTC (rev 3639)
+++ pkg/Rcpp/inst/NEWS	2012-06-23 17:07:05 UTC (rev 3640)
@@ -1,3 +1,15 @@
+0.9.12  2012-06-23
+
+    o   Corrected Rcpp::Environment class by removing (empty) ctor following
+        rev3592 (on May 2) where default argument for ctor was moved
+
+    o   Unit testing now supports argument --allTests to impose that all
+        tests are executed; otherwise some expensive tests are skipped. This
+	is arguably not the right thing to do, but CRAN maintainers insist 
+	on faster tests.
+
+    o   The cleanup script now also considers inst/unitTests/testRcppClass/src 
+
 0.9.11  2012-06-22
 
     o   New member function for vectors (and lists etc) containsElementNamed() 

Modified: pkg/Rcpp/inst/doc/unitTests/Rcpp-unitTests.R
===================================================================
--- pkg/Rcpp/inst/doc/unitTests/Rcpp-unitTests.R	2012-06-22 11:23:28 UTC (rev 3639)
+++ pkg/Rcpp/inst/doc/unitTests/Rcpp-unitTests.R	2012-06-23 17:07:05 UTC (rev 3640)
@@ -12,6 +12,9 @@
 	cxxfunction( ..., plugin = "Rcpp" )
 }
 
+## Make sure we run all tests for the vignette
+Sys.setenv("RunAllRcppTests"="yes")
+
 #load RUnit
 runit <- "RUnit" ; require( runit, character.only = TRUE )
 if( file.exists( "unitTests-results" ) ){ unlink("unitTests-results", recursive = TRUE ) }

Modified: pkg/Rcpp/inst/include/Rcpp/Environment.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Environment.h	2012-06-22 11:23:28 UTC (rev 3639)
+++ pkg/Rcpp/inst/include/Rcpp/Environment.h	2012-06-23 17:07:05 UTC (rev 3640)
@@ -167,8 +167,6 @@
     
         friend class Binding ;
     
-        Environment() ;
-    
         /**
          * wraps the given environment
          *

Modified: pkg/Rcpp/inst/include/Rcpp/config.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/config.h	2012-06-22 11:23:28 UTC (rev 3639)
+++ pkg/Rcpp/inst/include/Rcpp/config.h	2012-06-23 17:07:05 UTC (rev 3640)
@@ -27,7 +27,7 @@
 #endif
 
 #define Rcpp_Version(v,p,s) (((v) * 65536) + ((p) * 256) + (s))
-#define RCPP_VERSION Rcpp_Version(0,9,11)
+#define RCPP_VERSION Rcpp_Version(0,9,12)
 
 #endif
 

Modified: pkg/Rcpp/inst/unitTests/runTests.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runTests.R	2012-06-22 11:23:28 UTC (rev 3639)
+++ pkg/Rcpp/inst/unitTests/runTests.R	2012-06-23 17:07:05 UTC (rev 3640)
@@ -1,6 +1,6 @@
 ## -*- mode: R; tab-width: 4 -*-
 ##
-## Copyright (C) 2009- 2011	Dirk Eddelbuettel and Romain Francois
+## Copyright (C) 2009 - 2012  Dirk Eddelbuettel and Romain Francois
 ##
 ## This file is part of Rcpp.
 ##
@@ -17,17 +17,25 @@
 ## You should have received a copy of the GNU General Public License
 ## along with Rcpp.  If not, see <http://www.gnu.org/licenses/>.
 
+## Usage:
+##
+##   r some/path/to/runTests.R                 # defaults
+##   r some/path/to/runTests.R --local         # use cwd, not pkg dir
+##   r some/path/to/runTests.R --output=/tmp   # undo what BDR imposed
+##   r some/path/to/runTests.R --allTests      # undo what KH imposed
+##
+
 pkg <- "Rcpp"
 
-if( ! require( "inline", character.only = TRUE, quietly = TRUE ) ){
+if ( ! require( "inline", character.only = TRUE, quietly = TRUE ) ){
     stop( "The inline package is required to run Rcpp unit tests" )
 }
 
-if( compareVersion( packageDescription( "inline" )[["Version"]], "0.3.4.4" ) < 0 ){
+if ( compareVersion( packageDescription( "inline" )[["Version"]], "0.3.4.4" ) < 0 ){
     stop( "Rcpp unit tests need at least the version 0.3.4.4 of inline" )
 }
 
-if(require("RUnit", quietly = TRUE)) {
+if (require("RUnit", quietly = TRUE)) {
 
     is_local <- function(){
     	if( exists( "argv", globalenv() ) && "--local" %in% argv ) return(TRUE)
@@ -37,7 +45,7 @@
     if (is_local() ) path <- getwd()
 
     library(package=pkg, character.only = TRUE)
-    if(!(exists("path") && file.exists(path)))
+    if (!(exists("path"))) ## && file.exists(path)))
         path <- system.file("unitTests", package = pkg)
 
     ## --- Testing ---
@@ -47,21 +55,28 @@
                                  #     , testFileRegexp = "Vector"
                                  )
 
-    ## this is crass but as we time out on Windows we have no choice
-    ## but to disable a number of tests
     ## TODO: actually prioritize which ones we want
+    ##       for now, expensive tests (eg Modules, client packages) are skipped
     allTests <- function() {
-        if (.Platform$OS.type != "windows") return(TRUE)
-    	if (exists( "argv", globalenv() ) && "--allTests" %in% argv) return(TRUE)
-    	if ("--allTests" %in% commandArgs(TRUE)) return(TRUE)
-    	return(FALSE)
+    	if (exists( "argv", globalenv() ) && "--allTests" %in% argv) {
+            Sys.setenv("RunAllRcppTests"="yes")
+            return(TRUE)
+        }
+    	if ("--allTests" %in% commandArgs(TRUE)) {
+            Sys.setenv("RunAllRcppTests"="yes")
+            return(TRUE)
+        }
+        Sys.setenv("RunAllRcppTests"="no")
+        return(FALSE)
     }
     ## if (.Platform$OS.type == "windows" && allTests() == FALSE) {
     ##     ## by imposing [D-Z] (instead of an implicit A-Z) we are going from
     ##     ## 45 tests to run down to 38 (numbers as of release 0.8.3)
-    ##     testSuite$testFileRegexp <- "^runit.[D-Z]+\\.[rR]$"
+    ##     testSuite$testFileRegexp <- "^runit\\.[D-Z].+\\.[rR]$"
     ## }
 
+    allTests()                          # see if we want to set shortcut flag
+
     if (interactive()) {
         cat("Now have RUnit Test Suite 'testSuite' for package '", pkg,
             "' :\n", sep='')

Modified: pkg/Rcpp/inst/unitTests/runit.Module.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.Module.R	2012-06-22 11:23:28 UTC (rev 3639)
+++ pkg/Rcpp/inst/unitTests/runit.Module.R	2012-06-23 17:07:05 UTC (rev 3640)
@@ -1,7 +1,7 @@
 #!/usr/bin/r -t
 #       hey emacs, please make this use  -*- tab-width: 4 -*-
 #
-# Copyright (C) 2010	Dirk Eddelbuettel and Romain Francois
+# Copyright (C) 2010 - 2012  Dirk Eddelbuettel and Romain Francois
 #
 # This file is part of Rcpp.
 #
@@ -22,8 +22,10 @@
 	gc()
 }
 
-if( Rcpp:::capabilities()[["Rcpp modules"]] ) {
+.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
 
+if( .runThisTest && Rcpp:::capabilities()[["Rcpp modules"]] ) {
+
 test.Module <- function(){
 
 	inc  <- '

Modified: pkg/Rcpp/inst/unitTests/runit.Module.client.package.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.Module.client.package.R	2012-06-22 11:23:28 UTC (rev 3639)
+++ pkg/Rcpp/inst/unitTests/runit.Module.client.package.R	2012-06-23 17:07:05 UTC (rev 3640)
@@ -31,8 +31,7 @@
 ## It now (Dec 2011) appears to fail on Windows too
 .onWindows <- .Platform$OS.type == "windows"
 
-## Disabling this test for now as it fails in R-devel
-.runThisTest <- TRUE
+.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
 
 if (.runThisTest && Rcpp:::capabilities()[["Rcpp modules"]] && ! .badOSX && ! .onWindows) {
 

Modified: pkg/Rcpp/inst/unitTests/runit.XPTr.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.XPTr.R	2012-06-22 11:23:28 UTC (rev 3639)
+++ pkg/Rcpp/inst/unitTests/runit.XPTr.R	2012-06-23 17:07:05 UTC (rev 3640)
@@ -1,6 +1,7 @@
 #!/usr/bin/r -t
+#       hey emacs, please make this use  -*- tab-width: 4 -*-
 #
-# Copyright (C) 2009 - 2010	Romain Francois
+# Copyright (C) 2009 - 2012	 Dirk Eddelbuettel and Romain Francois
 #
 # This file is part of Rcpp.
 #
@@ -17,43 +18,48 @@
 # You should have received a copy of the GNU General Public License
 # along with Rcpp.  If not, see <http://www.gnu.org/licenses/>.
 
-test.XPtr <- function(){
+.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
 
-	funx <- cxxfunction(signature(), '
-		/* creating a pointer to a vector<int> */
-		std::vector<int>* v = new std::vector<int> ;
-		v->push_back( 1 ) ;
-		v->push_back( 2 ) ;
+if (.runThisTest) {
 
-		/* wrap the pointer as an external pointer */
-		/* this automatically protected the external pointer from R garbage
-		   collection until p goes out of scope. */
-		Rcpp::XPtr< std::vector<int> > p(v, true) ;
+    test.XPtr <- function(){
 
-		/* return it back to R, since p goes out of scope after the return
-		   the external pointer is no more protected by p, but it gets
-		   protected by being on the R side */
-		return( p ) ;
-	', plugin = "Rcpp" )
-	xp <- funx()
-	checkEquals( typeof( xp ), "externalptr",
-		msg = "checking external pointer creation" )
+        funx <- cxxfunction(signature(), '
+		    /* creating a pointer to a vector<int> */
+		    std::vector<int>* v = new std::vector<int> ;
+		    v->push_back( 1 ) ;
+		    v->push_back( 2 ) ;
 
-	# passing the pointer back to C++
-	funx <- cxxfunction(signature(x = "externalptr" ), '
-		/* wrapping x as smart external pointer */
-		/* The SEXP based constructor does not protect the SEXP from
-		   garbage collection automatically, it is already protected
-		   because it comes from the R side, however if you want to keep
-		   the Rcpp::XPtr object on the C(++) side
-		   and return something else to R, you need to protect the external
-		   pointer, by using the protect member function */
-		Rcpp::XPtr< std::vector<int> > p(x) ;
+		    /* wrap the pointer as an external pointer */
+		    /* this automatically protected the external pointer from R garbage
+		       collection until p goes out of scope. */
+		    Rcpp::XPtr< std::vector<int> > p(v, true) ;
 
-		/* just return the front of the vector as a SEXP */
-		return( Rcpp::wrap( p->front() ) ) ;
-	', plugin = "Rcpp" )
-	front <- funx(xp)
-	checkEquals( front, 1L, msg = "check usage of external pointer" )
+		    /* return it back to R, since p goes out of scope after the return
+		       the external pointer is no more protected by p, but it gets
+		       protected by being on the R side */
+		    return( p ) ;
+	    ', plugin = "Rcpp" )
+        xp <- funx()
+        checkEquals(typeof( xp ), "externalptr",
+                    msg = "checking external pointer creation" )
+
+        ## passing the pointer back to C++
+        funx <- cxxfunction(signature(x = "externalptr" ), '
+		    /* wrapping x as smart external pointer */
+		    /* The SEXP based constructor does not protect the SEXP from
+		       garbage collection automatically, it is already protected
+		       because it comes from the R side, however if you want to keep
+		       the Rcpp::XPtr object on the C(++) side
+		       and return something else to R, you need to protect the external
+		       pointer, by using the protect member function */
+		    Rcpp::XPtr< std::vector<int> > p(x) ;
+
+    		/* just return the front of the vector as a SEXP */
+    		return( Rcpp::wrap( p->front() ) ) ;
+    	', plugin = "Rcpp" )
+        front <- funx(xp)
+        checkEquals( front, 1L, msg = "check usage of external pointer" )
+    }
+
 }
-

Modified: pkg/Rcpp/inst/unitTests/runit.client.package.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.client.package.R	2012-06-22 11:23:28 UTC (rev 3639)
+++ pkg/Rcpp/inst/unitTests/runit.client.package.R	2012-06-23 17:07:05 UTC (rev 3640)
@@ -1,6 +1,6 @@
 #!/usr/bin/r -t
 #
-# Copyright (C) 2010 - 2011  Dirk Eddelbuettel and Romain Francois
+# Copyright (C) 2010 - 2012  Dirk Eddelbuettel and Romain Francois
 #
 # This file is part of Rcpp.
 #
@@ -20,6 +20,8 @@
 ## This now (Dec 2011) appears to fail on Windows
 .onWindows <- .Platform$OS.type == "windows"
 
+.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
+
 .client.package <- function( pkg = "RcppTestA" ){
     td <- tempfile()
     cwd <- getwd()
@@ -40,7 +42,7 @@
     checkException( .Call("hello_world_ex", PACKAGE = pkg ), msg = "exception in client package" )
 }
 
-if ( ! .onWindows ) {
+if ( .runThisTest && ! .onWindows ) {
     test.client.packageA <- function(){
         .client.package( "RcppTestA" )
     }

Modified: pkg/Rcpp/inst/unitTests/runit.macros.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.macros.R	2012-06-22 11:23:28 UTC (rev 3639)
+++ pkg/Rcpp/inst/unitTests/runit.macros.R	2012-06-23 17:07:05 UTC (rev 3640)
@@ -1,6 +1,6 @@
 #!/usr/bin/r -t
 #
-# Copyright (C) 2010	Dirk Eddelbuettel and Romain Francois
+# Copyright (C) 2010 - 2012  Dirk Eddelbuettel and Romain Francois
 #
 # This file is part of Rcpp.
 #
@@ -17,7 +17,10 @@
 # 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  ) {
+
 .getDll <- function( fx ){
 	env <- environment( fx at .Data )
 	f <- get( "f", env )
@@ -146,7 +149,7 @@
 	checkEquals( info[["class"]], "std::vector<int>" )
 	checkEquals( info[["method"]], "back")
 	checkEquals( class(info), "rcppxpmethodinfo" )
-	
+
 	f_push_back <- cxxfunction( signature( xp = "externalptr", x = "integer" ), '
 		vec_push_back( xp, x );
 		return R_NilValue ;
@@ -219,7 +222,7 @@
 
 ### regression test for long long support
 test.long.long <- function(){
-	
+
 	fx <- cxxfunction( signature(), '
 		return foo() ;
 	', includes = '
@@ -232,3 +235,4 @@
 
 }
 
+}

Modified: pkg/Rcpp/src/Environment.cpp
===================================================================
--- pkg/Rcpp/src/Environment.cpp	2012-06-22 11:23:28 UTC (rev 3639)
+++ pkg/Rcpp/src/Environment.cpp	2012-06-23 17:07:05 UTC (rev 3640)
@@ -23,8 +23,6 @@
 
 namespace Rcpp {
 
-    Environment::Environment() : RObject(R_NilValue){}
-
     Environment::Environment(SEXP x) : RObject(x){
         if( ! Rf_isEnvironment(x) ) {
             /* not an environment, but maybe convertible to one using as.environment, try that */



More information about the Rcpp-commits mailing list