[rkward-cvs] SF.net SVN: rkward:[3120] trunk/rkward/rkward/rbackend/rpackages/ rkwardtests
m-eik at users.sourceforge.net
m-eik at users.sourceforge.net
Mon Oct 11 09:14:34 UTC 2010
Revision: 3120
http://rkward.svn.sourceforge.net/rkward/?rev=3120&view=rev
Author: m-eik
Date: 2010-10-11 09:14:33 +0000 (Mon, 11 Oct 2010)
Log Message:
-----------
rkwardtests: working on initialising and resetting test environment
Modified Paths:
--------------
trunk/rkward/rkward/rbackend/rpackages/rkwardtests/R/rktest.makeplugintests.R
trunk/rkward/rkward/rbackend/rpackages/rkwardtests/R/rkwardtests-internal.R
trunk/rkward/rkward/rbackend/rpackages/rkwardtests/man/rktest.makeplugintests.Rd
Modified: trunk/rkward/rkward/rbackend/rpackages/rkwardtests/R/rktest.makeplugintests.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwardtests/R/rktest.makeplugintests.R 2010-10-08 20:05:16 UTC (rev 3119)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwardtests/R/rktest.makeplugintests.R 2010-10-11 09:14:33 UTC (rev 3120)
@@ -3,7 +3,8 @@
#' The function \code{rktest.makeplugintests} will run a whole test suite that was prepared to check one or several RKWard plugins.
#'
#' @title Run RKWard plugin test suite
-#' @usage rktest.makeplugintests(testsuites, testroot, outfile="make_plugintests.txt", append=FALSE, test.id=NULL)
+#' @usage rktest.makeplugintests(testsuites, testroot,
+#' outfile="make_plugintests.txt", append=FALSE, test.id=NULL)
#' @aliases rktest.makeplugintests
#' @param testsuites A character string or vector naming the test suites to be run.
#' @param testroot A character string pointing to the root directory where the test suite resides (including its folder with test standards).
@@ -18,8 +19,10 @@
#' @export
#' @examples
#' \dontrun{
-#' rktest.makeplugintests(testsuites=c("rkward_application_tests.R", "import_export_plugins.R"), testroot=getwd())
-#' rktest.makeplugintests(testsuites="distribution.R", testroot=getwd(), test.id=c("poisson_quantiles", "geom_quantiles"))
+#' rktest.makeplugintests(testsuites=c("rkward_application_tests.R",
+#' "import_export_plugins.R"), testroot=getwd())
+#' rktest.makeplugintests(testsuites="distribution.R",
+#' testroot=getwd(), test.id=c("poisson_quantiles", "geom_quantiles"))
#' }
rktest.makeplugintests <- function(testsuites, testroot, outfile="make_plugintests.txt", append=FALSE, test.id=NULL){
Modified: trunk/rkward/rkward/rbackend/rpackages/rkwardtests/R/rkwardtests-internal.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwardtests/R/rkwardtests-internal.R 2010-10-08 20:05:16 UTC (rev 3119)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwardtests/R/rkwardtests-internal.R 2010-10-11 09:14:33 UTC (rev 3120)
@@ -154,6 +154,12 @@
# Almost all tests depend on R2HTML, indirectly, so we should really assume it (or have the user install it) at the start
stopifnot (require (R2HTML))
+ # create a temporary dump of the current state of things we'll alter
+ # will be read by rktest.resetEnvironment()
+ assign(".rktest.tmp.dump",
+ list(.rk.rerun.plugin.link=.rk.rerun.plugin.link,
+ rk.set.output.html.file=rk.set.output.html.file),
+ envir=globalenv())
# 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 (...) }
@@ -186,5 +192,12 @@
# counterpart to rktest.initializeEnvironment. Restores the most important settings
rktest.resetEnvironment <- function () {
- .rk.rerun.plugin.link <<- .rk.rerun.plugin.link.replacement
+ # return to previously dumped state
+ assign(".rk.rerun.plugin.link",
+ .rktest.tmp.dump[[".rk.rerun.plugin.link"]],
+ envir=globalenv())
+ assign("rk.set.output.html.file",
+ .rktest.tmp.dump[["rk.set.output.html.file"]],
+ envir=globalenv())
+ rm(".rktest.tmp.dump", envir=globalenv())
}
Modified: trunk/rkward/rkward/rbackend/rpackages/rkwardtests/man/rktest.makeplugintests.Rd
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkwardtests/man/rktest.makeplugintests.Rd 2010-10-08 20:05:16 UTC (rev 3119)
+++ trunk/rkward/rkward/rbackend/rpackages/rkwardtests/man/rktest.makeplugintests.Rd 2010-10-11 09:14:33 UTC (rev 3120)
@@ -1,7 +1,8 @@
\name{rktest.makeplugintests}
\alias{rktest.makeplugintests}
\title{Run RKWard plugin test suite}
-\usage{rktest.makeplugintests(testsuites, testroot, outfile="make_plugintests.txt", append=FALSE, test.id=NULL)}
+\usage{rktest.makeplugintests(testsuites, testroot,
+outfile="make_plugintests.txt", append=FALSE, test.id=NULL)}
\description{Run a whole RKWard plugin test suite}
\details{The function \code{rktest.makeplugintests} will run a whole test suite that was prepared to check one or several RKWard plugins.}
\alias{rktest.makeplugintests}
@@ -17,7 +18,9 @@
\item{test.id}{An optional character string or vector naming one or more tests of a suite to be run (if NULL, all tests are run).}
}
\examples{\dontrun{
-rktest.makeplugintests(testsuites=c("rkward_application_tests.R", "import_export_plugins.R"), testroot=getwd())
-rktest.makeplugintests(testsuites="distribution.R", testroot=getwd(), test.id=c("poisson_quantiles", "geom_quantiles"))
+rktest.makeplugintests(testsuites=c("rkward_application_tests.R",
+"import_export_plugins.R"), testroot=getwd())
+rktest.makeplugintests(testsuites="distribution.R",
+testroot=getwd(), test.id=c("poisson_quantiles", "geom_quantiles"))
}}
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