Rev 58549 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/tools/man/testInstalledPackage.Rd% Part of the R package, http://www.R-project.org% Copyright 2009-11 R Core Team% Distributed under GPL 2 or later\name{testInstalledPackage}\alias{testInstalledPackage}\alias{testInstalledPackages}\alias{testInstalledBasic}\title{Test Installed Packages}\description{These functions allow an installed package to be tested, or all baseand recommended packages.}\usage{testInstalledPackage(pkg, lib.loc = NULL, outDir = ".",types = c("examples", "tests", "vignettes"),srcdir = NULL, Ropts = "")testInstalledPackages(outDir = ".", errorsAreFatal = TRUE,scope = c("both", "base", "recommended"),types = c("examples", "tests", "vignettes"),srcdir = NULL, Ropts = "")testInstalledBasic(scope = c("basic", "devel", "both"))}\arguments{\item{pkg}{name of an installed package.}\item{lib.loc}{library path(s) in which to look for the package. See\code{\link{library}}.}\item{outDir}{the directory into which to write the output files: thisshould already exist.}\item{types}{type(s) of tests to be done.}\item{errorsAreFatal}{logical: should testing terminate at the firsterror?}\item{srcdir}{Optional directory to look for \code{.save} files.}\item{Ropts}{Additional options such as \option{-d valgrind} to bepassed to \command{R CMD BATCH} when running examples or tests.}\item{scope}{Which set(s) should be tested?}}\details{These tests depend on having the package example files installed (whichis the default). If package-specific tests are found in a\file{tests} directory they can be tested: these are notinstalled by default, but will be if\command{R CMD INSTALL --install-tests} was used. Finally, the \Rcode in any vignettes can be extracted and tested.Package tests are run in a \file{\var{pkg}-tests} subdirectory of\file{outDir}, and leave their output there.\code{testInstalledBasic} runs the basic tests, if installed. Thisshould be run with \code{LC_COLLATE=C} set: the function tries to setthis by it may not work on all OSes. For non-English locales it maybe desirable to set environment variables \env{LANGUAGE} to \samp{en}and \env{LC_TIME} to \samp{C} to reduce the number of differences fromreference results.#ifdef unixThe package-specific tests for the base and recommended packages arenot normally installed, but \command{make install-tests} is providedto do so (as well as the basic tests).#endif#ifdef windowsThe package-specific tests for the base and recommended packages arean optional part of the install.Currently testing requires a Unix-like \code{diff} for a full reportif more than simple differences are found.#endif}\value{Invisibly \code{0L} for success, \code{1L} for failure.}\keyword{utilities}