\HeaderA{testInstalledPackage}{Test Installed Packages}{testInstalledPackage}
\aliasA{testInstalledBasic}{testInstalledPackage}{testInstalledBasic}
\aliasA{testInstalledPackages}{testInstalledPackage}{testInstalledPackages}
\keyword{utilities}{testInstalledPackage}
\begin{Description}\relax
These functions allow an installed package to be tested, or all base
and recommended packages.
\end{Description}
\begin{Usage}
\begin{verbatim}
testInstalledPackage(pkg, lib.loc = NULL, outDir = ".",
                     types = c("examples", "tests", "vignettes"))

testInstalledPackages(outDir = ".", errorsAreFatal = TRUE,
                      scope = c("both", "base", "recommended"),
                      types = c("examples", "tests", "vignettes"))

testInstalledBasic(scope = c("basic", "devel", "both"))
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{pkg}] name of an installed package.
\item[\code{lib.loc}] library path(s) in which to look for the package.  See
\code{\LinkA{library}{library}}.
\item[\code{outDir}] the directory into which to write the output files: this
should already exist.
\item[\code{types}] type(s) of tests to be done.
\item[\code{errorsAreFatal}] logical: should testing terminate at the first
error?
\item[\code{scope}] Which set(s) should be tested?
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
These tests depend on having the package example files installed (which
is the default).  If package-specific tests are found in a
\file{tests} directory they can be tested: these are not
installed by default, but will be if
\command{R CMD INSTALL --install-tests} was used.  Finally, the \R{}
code 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.  This
should be run with \code{LC\_COLLATE=C} set: the function tries to set
this by it may not work on all OSes.

The package-specific tests for the base and recommended packages are
not normally installed, but \command{make install-tests} is provided
to do so (as well as the basic tests).
\end{Details}
\begin{Value}
Invisbly \code{0L} for success, \code{1L} for failure.
\end{Value}

