[Sciviews-commits] r397 - pkg/svUnit/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Sep 19 10:49:58 CEST 2011


Author: mariotomo
Date: 2011-09-19 10:49:58 +0200 (Mon, 19 Sep 2011)
New Revision: 397

Modified:
   pkg/svUnit/R/runExamples.R
Log:
ticket:1575
(but if last test gives a warning, all tests get that warning)


Modified: pkg/svUnit/R/runExamples.R
===================================================================
--- pkg/svUnit/R/runExamples.R	2011-09-19 08:16:29 UTC (rev 396)
+++ pkg/svUnit/R/runExamples.R	2011-09-19 08:49:58 UTC (rev 397)
@@ -16,7 +16,11 @@
 
 makeTestListFromExamples <- function(packageName, manFilesDir) {
   manPageFiles <- list.files(manFilesDir, pattern="\\.Rd$")
-  manPages <- substr(manPageFiles, 1, nchar(manPageFiles) - 3)
+  manPages <- sapply(manPageFiles, function(filename) {
+    lines <- readLines(paste(manFilesDir, filename, sep="/"))
+    lines <- lines[grep("^\\\\name[ ]*\\{(.*)\\}", lines)]
+    sub("^\\\\name[ ]*\\{(.*)\\}", lines, replacement="\\1")
+  })
   manPages <- manPages[manPages != paste(packageName, "package", sep="-")]
 
   sapply(manPages, function(x) svTest(function() 



More information about the Sciviews-commits mailing list