[rkward-cvs] SF.net SVN: rkward:[2654] trunk/rkward/tests/test_framework.R

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Sep 23 15:33:10 UTC 2009


Revision: 2654
          http://rkward.svn.sourceforge.net/rkward/?rev=2654&view=rev
Author:   tfry
Date:     2009-09-23 15:33:08 +0000 (Wed, 23 Sep 2009)

Log Message:
-----------
Automatically (re)-set environment when running test suites

Modified Paths:
--------------
    trunk/rkward/tests/test_framework.R

Modified: trunk/rkward/tests/test_framework.R
===================================================================
--- trunk/rkward/tests/test_framework.R	2009-09-23 11:09:58 UTC (rev 2653)
+++ trunk/rkward/tests/test_framework.R	2009-09-23 15:33:08 UTC (rev 2654)
@@ -201,6 +201,7 @@
 }
 
 rktest.runRKTestSuite <- function (suite, basedir=getwd ()) {
+	rktest.initializeEnvironment ()
 	result <- new ("RKTestResult")		# FALSE by default
 
 	if (!inherits (suite, "RKTestSuite")) return (result)
@@ -267,21 +268,24 @@
 # .rk.rerun.plugin.link <- .rk.rerun.plugin.link.replacement
 
 ## Initialize test environment
-# By default .rk.rerun.plugin.link() and .rk.make.hr() are silenced during the test runs
-.rk.rerun.plugin.link <- .rk.make.hr <- function (...) { list (...) }
+rktest.initializeEnvironment <- function () {
+	# By default .rk.rerun.plugin.link() and .rk.make.hr() are silenced during the test runs
+	.rk.rerun.plugin.link <- .rk.make.hr <- function (...) { list (...) }
 
-# This should make the output of rk.graph.on() fixed
-rk.get.tempfile.name <- function (prefix, extension) paste (prefix, extension, sep="")
+	# This should make the output of rk.graph.on() fixed
+	rk.get.tempfile.name <- function (prefix, extension) paste (prefix, extension, sep="")
 
-# HACK: Override date, so we don't get a difference for each call of rk.header ()
-# TODO: implement a clean solution inside rk.header()
-date <- function () {
-	return ("DATE")
-}
+	# HACK: Override date, so we don't get a difference for each call of rk.header ()
+	# TODO: implement a clean solution inside rk.header()
+	date <- function () {
+		return ("DATE")
+	}
 
-# numerical precision is often a problem. To work around this in many places, reduce default printed precision to 5 digits
-options (digits=5)
+	# numerical precision is often a problem. To work around this in many places, reduce default printed precision to 5 digits
+	options (digits=5)
 
-# Make sure i18n does not get in the way
-invisible (Sys.setenv (LANGUAGE="C"))
-if (.Platform$OS.type == "unix") invisible (Sys.setlocale ("LC_MESSAGES", "C"))
+	# Make sure i18n does not get in the way
+	invisible (Sys.setenv (LANGUAGE="C"))
+	if (.Platform$OS.type == "unix") invisible (Sys.setlocale ("LC_MESSAGES", "C"))
+}
+rktest.initializeEnvironment ()


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list