[Sciviews-commits] r13 - in pkg: svGUI/man svUnit svUnit/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jun 25 18:52:18 CEST 2008


Author: phgrosjean
Date: 2008-06-25 18:52:17 +0200 (Wed, 25 Jun 2008)
New Revision: 13

Modified:
   pkg/svGUI/man/guiInstall.Rd
   pkg/svUnit/DESCRIPTION
   pkg/svUnit/NEWS
   pkg/svUnit/R/guiTestReport.R
   pkg/svUnit/R/svSuite.R
   pkg/svUnit/R/svTest.R
   pkg/svUnit/R/svUnit-internal.R
Log:
Bugs correction in svUnit related to file paths under Windows

Modified: pkg/svGUI/man/guiInstall.Rd
===================================================================
--- pkg/svGUI/man/guiInstall.Rd	2008-06-23 01:33:08 UTC (rev 12)
+++ pkg/svGUI/man/guiInstall.Rd	2008-06-25 16:52:17 UTC (rev 13)
@@ -17,12 +17,11 @@
 }
 
 \details{
-  The minimum instruction to set up everything in R to communication with Komodo
-  and SciViews-K extension installed is to use:
-  \code{option(ko.serve = 8888); require(svGUI)}. When the \code{ko.serve}
-  option is set, svGUI load svSocket, starts the socket server litening to the
-  port you give in \code{ko.serve} (8888 by default), and install the hooks and
-  callbacks required to fully communicate with Komodo.
+  The minimum instruction to install the communication with Komodo/SciViews-K
+  is to use: \code{options(ko.serve = 8888); require(svGUI)}. When the \code{ko.serve}
+  option is set, svGUI loads svSocket, starts the socket server litening to the
+  port you provide (8888 by default), and install the hooks and callbacks
+  required to fully communicate with Komodo.
 
   Before loading svGUI, you can also set \code{option(ko.port = 7052)} or
   another port number where the Komodo SciViews-K server is listening (7052 is

Modified: pkg/svUnit/DESCRIPTION
===================================================================
--- pkg/svUnit/DESCRIPTION	2008-06-23 01:33:08 UTC (rev 12)
+++ pkg/svUnit/DESCRIPTION	2008-06-25 16:52:17 UTC (rev 13)
@@ -3,8 +3,8 @@
 Depends: R (>= 1.9.0)
 Suggests: svGUI, datasets, utils
 Description: A complete unit test system and functions to implement its GUI part
-Version: 0.6-0
-Date: 2008-06-23
+Version: 0.6-1
+Date: 2008-06-25
 Author: Philippe Grosjean
 Maintainer: Philippe Grosjean <phgrosjean at sciviews.org>
 License: GPL 2 or above

Modified: pkg/svUnit/NEWS
===================================================================
--- pkg/svUnit/NEWS	2008-06-23 01:33:08 UTC (rev 12)
+++ pkg/svUnit/NEWS	2008-06-25 16:52:17 UTC (rev 13)
@@ -1,5 +1,13 @@
 = svUnit News
 
+== svUnit 0.6-1
+* Correction of a bug in Windows relative to path separators \\ versus /,
+especially usinf tempdir().
+
+* Correction of a bug that prevented to list runit*.R files in the unitTests
+subdirectory of a package under Windows.
+
+
 == svUnit 0.6-0
 * The package does not depends any more from RUnit. It has his own checkXXX()
 function (they are compatible with those in RUnit 0.4.17, except that here the

Modified: pkg/svUnit/R/guiTestReport.R
===================================================================
--- pkg/svUnit/R/guiTestReport.R	2008-06-23 01:33:08 UTC (rev 12)
+++ pkg/svUnit/R/guiTestReport.R	2008-06-25 16:52:17 UTC (rev 13)
@@ -74,16 +74,17 @@
 		Types <- rep("units in packages", length(Units))
 		Types[Units == ""] <- "other objects"
 		### TODO: include also dirs!
-		Dir1 <- dirname(Units)
+		Dir1 <- gsub("\\\\", "/", dirname(Units))
 		Dir2 <- dirname(Dir1)
 		Dir3 <- dirname(Dir2)
-		Types[Dir1 == tempdir()] <- "objects in .GlobalEnv"
+		TempDir <- gsub("\\\\", "/", tempdir())
+		Types[Dir1 == TempDir] <- "objects in .GlobalEnv"
 		Types[tolower(basename(Dir2)) == "inst" ||
 			tolower(basename(Dir3)) == "inst"] <- "units in sources"
 		# Keep only "*" in Units
 		Units <- basename(Units)
 		Units[regexpr("^runit.+\\.[rR]$", Units) == -1] <- ""
-		Units[Dir1 == tempdir()] <- ""	# No second level for objects in .GlobalEnv
+		Units[Dir1 == TempDir] <- ""	# No second level for objects in .GlobalEnv
 		Units <- sub("^runit(.+)\\.[rR]$", "\\1", Units)
 		change <- Units != ""
 		Units[change] <- paste(">unit", Units[change])

Modified: pkg/svUnit/R/svSuite.R
===================================================================
--- pkg/svUnit/R/svSuite.R	2008-06-23 01:33:08 UTC (rev 12)
+++ pkg/svUnit/R/svSuite.R	2008-06-25 16:52:17 UTC (rev 13)
@@ -183,6 +183,8 @@
 	if (!is.svSuite(x))
 		stop("'x' must be a 'svSuite' object")
 	name <- as.character(name)[1]
+	# Under Windows, we transform \\ into /
+	dir <- gsub("\\\\", "/", as.character(dir)[1])
 	# Collect all items that are not 'package:...' or 'dir:...'
 	isObj <- regexpr("^[package:|dir:]", x) == -1
 	Objs <- sub("^test[(](.+)[)]$", "\\1", x[isObj])
@@ -216,9 +218,13 @@
 		Subdirs[Subdirs == Pkgs] <- ""
 		Pkgs <- sub("^package:([^ ]+).*$", "\\1", Pkgs)
 		for (i in 1:length(Pkgs)) {
+			if (Subdirs[i] == "") {
+			dir <- system.file(package = Pkgs[i], "unitTests")
+		} else {
 			dir <- system.file(package = Pkgs[i], "unitTests", Subdirs[i])
-				if (dir != "") dirs <- c(dirs, dir)
 		}
+			if (dir != "") dirs <- c(dirs, dir)
+		}
 	}
 
 	# Add directories, and possibly make a temporary unit for test objects
@@ -244,6 +250,8 @@
 		files <- c(files, list.files(dir, pattern = "^runit.+\\.[rR]$",
 			full.names = TRUE))
 	if (length(files) == 0) return(NULL)	# Nothing to run!
+	# Under Windows, transform all \\ into / in the file names
+	files <- gsub("\\\\", "/", files)
 	# Run this test suite now, that is, source each file in .TestSuiteEnv
 	# and run each testxxx function in it, using .setUp and .tearDown too
 	# Record the list of tests

Modified: pkg/svUnit/R/svTest.R
===================================================================
--- pkg/svUnit/R/svTest.R	2008-06-23 01:33:08 UTC (rev 12)
+++ pkg/svUnit/R/svTest.R	2008-06-25 16:52:17 UTC (rev 13)
@@ -72,6 +72,8 @@
 	# It is saved in a file runit<name>.R in 'dir'
 	name <- as.character(name)[1]
 	name <- sub("^test\\.(.+)\\.$", "\\1", name)
+	# Under Windows, we transform \\ into /
+	dir <- gsub("\\\\", "/", as.character(dir)[1])
 	Unit <- .prepareUnit(name, dir)
 	# Just get the test from the object
 	Test <- test(x)

Modified: pkg/svUnit/R/svUnit-internal.R
===================================================================
--- pkg/svUnit/R/svUnit-internal.R	2008-06-23 01:33:08 UTC (rev 12)
+++ pkg/svUnit/R/svUnit-internal.R	2008-06-25 16:52:17 UTC (rev 13)
@@ -211,13 +211,13 @@
 .prepareUnit <-
 function (name, dir) {
 	# Prepare for writing a test unit file
-	dir <- as.character(dir)[1]
+	dir <- gsub("\\\\", "/", as.character(dir)[1])
 	# Check that dir exists (do not create it!)
 	if (!file.exists(dir) || !file.info(dir)$isdir)
 		stop("'dir' must be an existing directory")
 	# If dir is tempdir(), then, make sure there are no other runit*.R files
 	# left (should not!) - One can store only one unit at a time in tempdir()!
-	if (dir == tempdir()) {
+	if (dir == gsub("\\\\", "/", tempdir())) {
 		runitfiles <- list.files(dir, pattern = "^runit.*\\.[r|R]$",
 			full.names = TRUE)
 		unlink(runitfiles)



More information about the Sciviews-commits mailing list