[Rprotobuf-commits] r573 - in pkg: . vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Dec 19 03:02:23 CET 2013


Author: edd
Date: 2013-12-19 03:02:22 +0100 (Thu, 19 Dec 2013)
New Revision: 573

Removed:
   pkg/vignettes/unitTests/
Modified:
   pkg/ChangeLog
   pkg/cleanup
   pkg/vignettes/RProtoBuf-unitTests.Rnw
Log:
rewritten / simplified unitTests vignette


Modified: pkg/ChangeLog
===================================================================
--- pkg/ChangeLog	2013-12-19 01:23:37 UTC (rev 572)
+++ pkg/ChangeLog	2013-12-19 02:02:22 UTC (rev 573)
@@ -2,6 +2,8 @@
 
 	* vignettes/RProtoBuf-intro.Rnw: Use with vignette builder
 	* vignettes/RProtoBuf-quickref.Rnw: Idem
+	* vignettes/RProtoBuf-unitTests.Rnw: Rewritten / simplified
+
 	* DESCRIPTION: Increased dependency to R (>= 3.0.0)
 
 	* configure.in: No longer create vignettes/Makefile

Modified: pkg/cleanup
===================================================================
--- pkg/cleanup	2013-12-19 01:23:37 UTC (rev 572)
+++ pkg/cleanup	2013-12-19 02:02:22 UTC (rev 573)
@@ -4,9 +4,11 @@
     src/addressbook.pb.cc src/addressbook.pb.h \
     src/protobufrpc.pb.cc src/protobufrpc.pb.h \
     src/*.o src/*.d src/*.a src/*.dll src/*.so src/*.rc */*~ *~ \
-    src/symbols.rds 
+    src/symbols.rds \
+    vignettes/RProtoBuf*.aux vignettes/RProtoBuf*.log \
+    vignettes/RProtoBuf*.out vignettes/RProtoBuf*.toc \
+    vignettes/RProtoBuf*.tex
+
 rm -rf inst/doc/auto
 
-( cd vignettes; rm -f RProtoBuf*.aux RProtoBuf*.log \
-                      RProtoBuf*.out RProtoBuf*.toc )
 

Modified: pkg/vignettes/RProtoBuf-unitTests.Rnw
===================================================================
--- pkg/vignettes/RProtoBuf-unitTests.Rnw	2013-12-19 01:23:37 UTC (rev 572)
+++ pkg/vignettes/RProtoBuf-unitTests.Rnw	2013-12-19 02:02:22 UTC (rev 573)
@@ -1,21 +1,63 @@
 \documentclass[10pt]{article}
 %\VignetteIndexEntry{RProtoBuf-unitTests}
+%\VignetteKeywords{RProtoBuf, Protocol Buffers, package}
+%\VignetteDepends{RProtoBuf}
+
 \usepackage{vmargin}
 \setmargrb{0.75in}{0.75in}{0.75in}{0.75in}
 
+<<echo=FALSE,print=FALSE>>=
+require(RProtoBuf)
+prettyVersion <- packageDescription("RProtoBuf")$Version
+prettyDate <- format(Sys.Date(), "%B %e, %Y")
+library(RUnit)
+@
+
 \usepackage[colorlinks]{hyperref}
 \author{Romain Fran\c{c}ois \and Dirk Eddelbuettel \and Murray Stokely}
 \title{RProtoBuf : Unit testing results}
+\date{RProtoBuf version \Sexpr{prettyVersion} as of \Sexpr{prettyDate}}
+
 \begin{document}
 \maketitle
 
+\section*{Test Execution}
+
+<<unitTesting,echo=FALSE,print=FALSE>>=
+pkg <- "RProtoBuf"
+
+if (file.exists("unitTests-results")) unlink("unitTests-results", recursive = TRUE)
+dir.create("unitTests-results")
+pathRcppTests <<- 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) cat(sprintf("unit test problems: %d failures", err$nFail))
+if (err$nErr > 0) cat(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=FALSE,results=tex>>=
-results <- "unitTests-results/RProtoBuf-unitTests.txt"
-if( file.exists( results ) ){
-	writeLines( readLines( results ) )
+<<importResults,echo=FALSE,results=tex>>=
+results <- sprintf("unitTests-results/%s-unitTests.txt", pkg)
+if (file.exists(results)) {
+    writeLines(readLines(results))
+} else{
+    writeLines("Unit test results not available")
 }
 @
+
 \end{verbatim}
 
 \end{document}



More information about the Rprotobuf-commits mailing list