forked from Rdatatable/data.table
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.data.table.Rd
39 lines (38 loc) · 2.53 KB
/
test.data.table.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
\name{test.data.table}
\alias{test.data.table}
\title{ Runs a set of tests. }
\description{
Runs a set of tests to check data.table is working correctly.
}
\usage{
test.data.table(script = "tests.Rraw", verbose = FALSE, pkg = ".",
silent = FALSE,
showProgress = interactive() && !silent,
testPattern = NULL,
memtest = Sys.getenv("TEST_DATA_TABLE_MEMTEST", 0),
memtest.id = NULL)
}
\arguments{
\item{script}{ Run arbitrary R test script. }
\item{verbose}{ \code{TRUE} sets \code{options(datatable.verbose=TRUE)} for the duration of the tests. This tests there are no errors in the branches that produce the verbose output, and produces a lot of output. The output is normally used for tracing bugs or performance tuning. Tests which specifically test the verbose output is correct (typically looking for an expected substring) always run regardless of this option. }
\item{pkg}{ Root directory name under which all package content (ex: DESCRIPTION, src/, R/, inst/ etc..) resides. Used only in \emph{dev-mode}. }
\item{silent}{ Controls what happens if a test fails. Like \code{silent} in \code{\link{try}}, \code{TRUE} causes the error message to be suppressed and \code{FALSE} to be returned, otherwise the error is returned. }
\item{showProgress}{ Output 'Running test <n> ...\\r' at the start of each test? }
\item{testPattern}{ When present, a regular expression tested against the number of each test for inclusion. Useful for running only a small portion of a large test script. }
\item{memtest}{ Measure and report memory usage of tests (1:gc before ps, 2:gc after ps) rather than time taken (0) by default. Intended for and tested on Linux. See PR #5515 for more details. }
\item{memtest.id}{ An id for which to print memory usage for every sub id. May be a range of ids. }
}
\details{
Runs a series of tests. These can be used to see features and examples of usage, too. Running test.data.table will tell you the full location of the test file(s) to open.
Setting \code{silent=TRUE} sets \code{showProgress=FALSE} too, via the default of \code{showProgress}.
}
\value{
If all tests were successful, \code{TRUE} is returned. Otherwise, see the \code{silent} argument above. \code{silent=TRUE} is intended for use at the start of production scripts; e.g. \code{stopifnot(test.data.table(silent=TRUE))} to check \code{data.table} is passing its own tests before proceeding.
}
\seealso{ \code{\link{data.table}}, \code{\link{test}} }
\examples{
\dontrun{
test.data.table()
}
}
\keyword{ data }