[Rcpp-commits] r4430 - pkg/RcppArmadillo/vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Aug 13 04:01:42 CEST 2013


Author: edd
Date: 2013-08-13 04:01:35 +0200 (Tue, 13 Aug 2013)
New Revision: 4430

Modified:
   pkg/RcppArmadillo/vignettes/
   pkg/RcppArmadillo/vignettes/Makefile
   pkg/RcppArmadillo/vignettes/RcppArmadillo-unitTests.Rnw
Log:
set some more svn ignores


Property changes on: pkg/RcppArmadillo/vignettes
___________________________________________________________________
Modified: svn:ignore
   - unitTests-results/
unitTests-results/
RcppArmadillo-unitTests.pdf
RcppArmadillo-intro.pdf

   + unitTests-results/
unitTests-results/
RcppArmadillo-unitTests.pdf
RcppArmadillo-intro.pdf
unitTests-results/RcppArmadillo-unitTests.R
unitTests-results/RcppArmadillo-unitTests.txt
unitTests-results/RcppArmadillo-unitTests.html


Modified: pkg/RcppArmadillo/vignettes/Makefile
===================================================================
--- pkg/RcppArmadillo/vignettes/Makefile	2013-08-13 00:56:02 UTC (rev 4429)
+++ pkg/RcppArmadillo/vignettes/Makefile	2013-08-13 02:01:35 UTC (rev 4430)
@@ -1,5 +1,5 @@
 
-all: 	RcppArmadillo-unitTests.pdf RcppArmadillo-intro.pdf
+all: 	RcppArmadillo-intro.pdf
 
 pdfclean:
 	rm -f RcppArmadillo-unitTests.pdf RcppArmadillo-intro.pdf
@@ -11,17 +11,12 @@
 RPROG=	$(R_HOME)/bin/R
 RSCRIPT=$(R_HOME)/bin/Rscript
 
-RcppArmadillo-unitTests.pdf:
-	rm -fr unitTests-results/*
-	$(RSCRIPT) unitTests/RcppArmadillo-unitTests.R
-	$(RPROG) CMD Sweave RcppArmadillo-unitTests.Rnw
-	$(RSCRIPT) -e "tools::texi2dvi( 'RcppArmadillo-unitTests.tex', pdf = TRUE, clean = TRUE )"
-	rm -fr RcppArmadillo-unitTests.tex
-
-RcppArmadillo-intro.pdf:
+RcppArmadillo-intro.pdf: 
 	${RPROG} CMD Sweave RcppArmadillo-intro.Rnw
 	pdflatex -shell-escape RcppArmadillo-intro
 	bibtex RcppArmadillo-intro
 	pdflatex -shell-escape RcppArmadillo-intro
 	pdflatex -shell-escape RcppArmadillo-intro
-	rm RcppArmadillo-intro.aux RcppArmadillo-intro.log RcppArmadillo-intro.bbl RcppArmadillo-intro.blg RcppArmadillo-intro.tex RcppArmadillo-intro.spl
+	rm RcppArmadillo-intro.aux RcppArmadillo-intro.log \
+		RcppArmadillo-intro.bbl RcppArmadillo-intro.blg \
+		RcppArmadillo-intro.tex RcppArmadillo-intro.spl

Modified: pkg/RcppArmadillo/vignettes/RcppArmadillo-unitTests.Rnw
===================================================================
--- pkg/RcppArmadillo/vignettes/RcppArmadillo-unitTests.Rnw	2013-08-13 00:56:02 UTC (rev 4429)
+++ pkg/RcppArmadillo/vignettes/RcppArmadillo-unitTests.Rnw	2013-08-13 02:01:35 UTC (rev 4430)
@@ -1,20 +1,65 @@
 \documentclass[10pt]{article}
 %\VignetteIndexEntry{RcppArmadillo-unitTests}
+%\VignetteKeywords{R,Armadillo,Rcpp,unit tests}
+%\VignettePackage{RcppArmadillo}
+
 \usepackage{vmargin}
 \setmargrb{0.75in}{0.75in}{0.75in}{0.75in}
 
+\RequirePackage{ae,mathpple}    % ae as a default font pkg works with Sweave
+\RequirePackage[T1]{fontenc}
+
+<<echo=FALSE,print=FALSE>>=
+require(RcppArmadillo)
+prettyVersion <- packageDescription("RcppArmadillo")$Version
+prettyDate <- format(Sys.Date(), "%B %e, %Y")
+library(RUnit)
+@
+
 \usepackage[colorlinks]{hyperref}
 \author{Dirk Eddelbuettel, Romain Fran\c{c}ois and Douglas Bates}
 \title{RcppArmadillo : Unit testing results}
+\date{\texttt{RcppArmadillo} version \Sexpr{prettyVersion} as of \Sexpr{prettyDate}}
+
 \begin{document}
 \maketitle
 
+\section*{Test Execution}
+
+<<unitTesting,echo=FALSE,print=FALSE>>=
+pkg <- "RcppArmadillo"
+if (file.exists("unitTests-results")) unlink("unitTests-results", recursive = TRUE)
+dir.create("unitTests-results")
+pathRcppArmadilloTests <<- system.file("unitTests", package = pkg)
+path <- system.file("unitTests", package=pkg)
+testSuite <- defineTestSuite(name=paste(pkg, "unit testing"), dirs=path)
+tests <- runTestSuite(testSuite)
+err <- getErrors(tests)
+if (err$nFail > 0) stop(sprintf("unit test problems: %d failures", err$nFail))
+if (err$nErr > 0) stop( sprintf("unit test problems: %d errors", err$nErr))
+printHTMLProtocol(tests, fileName=sprintf("unitTests-results/%s-unitTests.html", pkg))
+printTextProtocol(tests, fileName=sprintf("unitTests-results/%s-unitTests.txt" , pkg))
+
+if (file.exists("/tmp")) {
+    invisible(sapply(c("txt", "html"), function(ext) {
+        fname <- sprintf("unitTests-results/%s-unitTests.%s", pkg, ext)
+        file.copy(fname, "/tmp", overwrite=TRUE)
+    }))
+}
+@
+
+\section*{Test Results}
+
 \begin{verbatim}
-<<echo=F,results=tex>>=
-if( file.exists( "unitTests-results/RcppArmadillo-unitTests.txt" ) ){
-	writeLines( readLines( "unitTests-results/RcppArmadillo-unitTests.txt" ) )
+<<importResults,echo=FALSE,results=tex>>=
+results <- "unitTests-results/RcppArmadillo-unitTests.txt"
+if (file.exists(results)) {
+    writeLines(readLines(results))
+} else{
+    writeLines( "unit test results not available" )
 }
 @
+
 \end{verbatim}
 
 \end{document}



More information about the Rcpp-commits mailing list