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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 15 21:08:33 CEST 2011


Author: dmbates
Date: 2011-06-15 21:08:33 +0200 (Wed, 15 Jun 2011)
New Revision: 3086

Added:
   pkg/RcppEigen/cleanup
   pkg/RcppEigen/inst/doc/
   pkg/RcppEigen/inst/doc/Makefile
   pkg/RcppEigen/inst/doc/RcppEigen-unitTests.Rnw
   pkg/RcppEigen/inst/doc/unitTests/
   pkg/RcppEigen/inst/doc/unitTests/RcppEigen-unitTests.R
   pkg/RcppEigen/inst/doc/unitTests/RcppEigen-unitTests.Rnw
Log:
Documentation based on unit tests.


Added: pkg/RcppEigen/cleanup
===================================================================
--- pkg/RcppEigen/cleanup	                        (rev 0)
+++ pkg/RcppEigen/cleanup	2011-06-15 19:08:33 UTC (rev 3086)
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+rm -f  src/*.o src/*.so \
+       inst/doc/RcppEigen-unitTests.out \
+       inst/doc/RcppEigen-unitTests.aux \
+       inst/doc/RcppEigen-unitTests.log \
+       */*~ *~
+rm -rf autom4te.cache


Property changes on: pkg/RcppEigen/cleanup
___________________________________________________________________
Added: svn:executable
   + *

Added: pkg/RcppEigen/inst/doc/Makefile
===================================================================
--- pkg/RcppEigen/inst/doc/Makefile	                        (rev 0)
+++ pkg/RcppEigen/inst/doc/Makefile	2011-06-15 19:08:33 UTC (rev 3086)
@@ -0,0 +1,23 @@
+
+all: 	RcppEigen-unitTests.pdf
+
+clean:	
+	rm -f RcppEigen*.log RcppEigen*.aux RcppEigen*.out RcppEigen*.tex
+
+pdfclean:
+	rm -f RcppEigen-unitTests.pdf
+
+setvars:
+ifeq (${R_HOME},)
+R_HOME=	$(shell R RHOME)
+endif
+RPROG=	$(R_HOME)/bin/R
+RSCRIPT=$(R_HOME)/bin/Rscript
+
+RcppEigen-unitTests.pdf:
+	rm -fr unitTests-results/*
+	$(RSCRIPT) unitTests/RcppEigen-unitTests.R
+	$(RPROG) CMD Sweave RcppEigen-unitTests.Rnw
+	$(RSCRIPT) -e "tools::texi2dvi( 'RcppEigen-unitTests.tex', pdf = TRUE, clean = TRUE )"
+	rm -fr RcppEigen-unitTests.tex
+

Added: pkg/RcppEigen/inst/doc/RcppEigen-unitTests.Rnw
===================================================================
--- pkg/RcppEigen/inst/doc/RcppEigen-unitTests.Rnw	                        (rev 0)
+++ pkg/RcppEigen/inst/doc/RcppEigen-unitTests.Rnw	2011-06-15 19:08:33 UTC (rev 3086)
@@ -0,0 +1,20 @@
+\documentclass[10pt]{article}
+%\VignetteIndexEntry{RcppEigen-unitTests}
+\usepackage{vmargin}
+\setmargrb{0.75in}{0.75in}{0.75in}{0.75in}
+
+\usepackage[colorlinks]{hyperref}
+\author{Dirk Eddelbuettel, Romain Fran\c{c}ois and Douglas Bates}
+\title{RcppEigen : Unit testing results}
+\begin{document}
+\maketitle
+
+\begin{verbatim}
+<<echo=F,results=tex>>=
+if( file.exists( "unitTests-results/RcppEigen-unitTests.txt" ) ){
+	writeLines( readLines( "unitTests-results/RcppEigen-unitTests.txt" ) )
+}
+@
+\end{verbatim}
+
+\end{document}

Added: pkg/RcppEigen/inst/doc/unitTests/RcppEigen-unitTests.R
===================================================================
--- pkg/RcppEigen/inst/doc/unitTests/RcppEigen-unitTests.R	                        (rev 0)
+++ pkg/RcppEigen/inst/doc/unitTests/RcppEigen-unitTests.R	2011-06-15 19:08:33 UTC (rev 3086)
@@ -0,0 +1,20 @@
+pkg <- "RcppEigen"
+
+# 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 )
+}
+



More information about the Rcpp-commits mailing list