[Rcpp-commits] r535 - in pkg/inst: . doc doc/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jan 31 21:27:31 CET 2010


Author: romain
Date: 2010-01-31 21:27:30 +0100 (Sun, 31 Jan 2010)
New Revision: 535

Added:
   pkg/inst/doc/unitTests/
   pkg/inst/doc/unitTests/Rcpp-unitTests.R
   pkg/inst/doc/unitTests/Rcpp-unitTests.Rnw
Modified:
   pkg/inst/ChangeLog
   pkg/inst/doc/Makefile
   pkg/inst/doc/Rcpp-unitTests.Rnw
Log:
factor out the logic from the vignette to avoid re-executing all the unit tests inside the vignette in R CMD check

Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2010-01-31 20:16:35 UTC (rev 534)
+++ pkg/inst/ChangeLog	2010-01-31 20:27:30 UTC (rev 535)
@@ -8,13 +8,14 @@
 
 	* src/Rcpp/internal/wrap.h: more wrap for stl templates are
 	candidate for wrap (when T can be wrapped)
-	multiset<T>                   -> vector or list
-	map<string,T>                 -> named vector or named list
-	multimap<string,T>            -> named vector or named list
-	tr1::unordered_map<string,T>  -> named vector or named list
-	tr1::unordered_set<T>         -> vector or list
-	tr1::unordered_multiset<T>    -> vector or list
-
+	std::list<T>	                      -> vector or list
+	std::multiset<T>                   -> vector or list
+	std::map<std::string,T>                 -> named vector or named list
+	std::multimap<std::string,T>            -> named vector or named list
+	std::tr1::unordered_map<std::string,T>  -> named vector or named list
+	std::tr1::unordered_set<T>         -> vector or list
+	std::tr1::unordered_multiset<T>    -> vector or list
+	
 	* inst/unitTests/runit.wrap.R : unit tests for the new
 	wrappable types
 

Modified: pkg/inst/doc/Makefile
===================================================================
--- pkg/inst/doc/Makefile	2010-01-31 20:16:35 UTC (rev 534)
+++ pkg/inst/doc/Makefile	2010-01-31 20:27:30 UTC (rev 535)
@@ -1,9 +1,21 @@
 
-all: clean index.html
+all: clean index.html Rcpp-unitTests.pdf
 
 clean:
+	touch Rcpp-unitTests.pdf
+	rm Rcpp-unitTests.pdf
 	rm index.html
 
 index.html: rcpp.index.html
 	cp rcpp.index.html index.html
 
+Rcpp-unitTests.pdf:
+	rm -fr unitTests-results/*
+	cp unitTests/Rcpp-unitTests.Rnw .
+	cp unitTests/Rcpp-unitTests.R .
+	Rscript Rcpp-unitTests.R
+	R CMD Sweave Rcpp-unitTests.Rnw
+	Rscript -e "tools::texi2dvi( 'Rcpp-unitTests.tex', pdf = TRUE, clean = TRUE )"
+	rm -fr Rcpp-unitTests.R
+	rm -fr Rcpp-unitTests.tex
+

Modified: pkg/inst/doc/Rcpp-unitTests.Rnw
===================================================================
--- pkg/inst/doc/Rcpp-unitTests.Rnw	2010-01-31 20:16:35 UTC (rev 534)
+++ pkg/inst/doc/Rcpp-unitTests.Rnw	2010-01-31 20:27:30 UTC (rev 535)
@@ -9,28 +9,6 @@
 \begin{document}
 \maketitle
 
-<<echo=FALSE,results=hide>>=
-pkg <- "Rcpp"
-
-# load this package
-require( pkg, character.only = TRUE )
-
-#load RUnit
-runit <- "RUnit" ; require( runit, character.only = TRUE )
-if( file.exists( "unitTests-results" ) ){ unlink("unitTests-results", recursive = TRUE ) }
-dir.create( "unitTests-results" ) 
-
-path <- system.file("unitTests", package = pkg)
-testSuite <- defineTestSuite(name=paste(pkg, "unit testing"), dirs = path)
-tests <- runTestSuite(testSuite)
-printHTMLProtocol(tests, fileName= sprintf( "unitTests-results/%s-unitTests.html" , pkg ) )
-printTextProtocol(tests, fileName= sprintf( "unitTests-results/%s-unitTests.txt"  , pkg ) )
-if( file.exists( "/tmp" ) ){
-	file.copy( sprintf( "unitTests-results/%s-unitTests.txt" , pkg ) , "/tmp", overwrite = TRUE )
-	file.copy( sprintf( "unitTests-results/%s-unitTests.html", pkg ) , "/tmp", overwrite = TRUE )
-}
-@
-
 \begin{verbatim}
 <<echo=F,results=tex>>=
 writeLines( readLines( "unitTests-results/Rcpp-unitTests.txt" ) ) 

Added: pkg/inst/doc/unitTests/Rcpp-unitTests.R
===================================================================
--- pkg/inst/doc/unitTests/Rcpp-unitTests.R	                        (rev 0)
+++ pkg/inst/doc/unitTests/Rcpp-unitTests.R	2010-01-31 20:27:30 UTC (rev 535)
@@ -0,0 +1,20 @@
+pkg <- "Rcpp"
+
+# load this package
+require( pkg, character.only = TRUE )
+
+#load RUnit
+runit <- "RUnit" ; require( runit, character.only = TRUE )
+if( file.exists( "unitTests-results" ) ){ unlink("unitTests-results", recursive = TRUE ) }
+dir.create( "unitTests-results" ) 
+
+path <- system.file("unitTests", package = pkg)
+testSuite <- defineTestSuite(name=paste(pkg, "unit testing"), dirs = path)
+tests <- runTestSuite(testSuite)
+printHTMLProtocol(tests, fileName= sprintf( "unitTests-results/%s-unitTests.html" , pkg ) )
+printTextProtocol(tests, fileName= sprintf( "unitTests-results/%s-unitTests.txt"  , pkg ) )
+if( file.exists( "/tmp" ) ){
+	file.copy( sprintf( "unitTests-results/%s-unitTests.txt" , pkg ) , "/tmp", overwrite = TRUE )
+	file.copy( sprintf( "unitTests-results/%s-unitTests.html", pkg ) , "/tmp", overwrite = TRUE )
+}
+

Added: pkg/inst/doc/unitTests/Rcpp-unitTests.Rnw
===================================================================
--- pkg/inst/doc/unitTests/Rcpp-unitTests.Rnw	                        (rev 0)
+++ pkg/inst/doc/unitTests/Rcpp-unitTests.Rnw	2010-01-31 20:27:30 UTC (rev 535)
@@ -0,0 +1,18 @@
+\documentclass[10pt]{article}
+%\VignetteIndexEntry{Rcpp-unitTests}
+\usepackage{vmargin}
+\setmargrb{0.75in}{0.75in}{0.75in}{0.75in}
+
+\usepackage[colorlinks]{hyperref}
+\author{Dirk Eddelbuettel \and Romain Fran\c{c}ois}
+\title{Rcpp : Unit testing results}
+\begin{document}
+\maketitle
+
+\begin{verbatim}
+<<echo=F,results=tex>>=
+writeLines( readLines( "unitTests-results/Rcpp-unitTests.txt" ) ) 
+@
+\end{verbatim}
+
+\end{document}



More information about the Rcpp-commits mailing list