testthat: Unit Testing for R

A unit testing system designed to be fun, flexible and easy to set up.

AuthorHadley Wickham [aut, cre], RStudio [cph]
Date of publication2016-04-23 08:37:40
MaintainerHadley Wickham <hadley@rstudio.com>
LicenseMIT + file LICENSE
Version1.0.2
https://github.com/hadley/testthat

View on CRAN

Man pages

auto_test: Watches code and tests for changes, rerunning tests as...

auto_test_package: Watches a package for changes, rerunning tests as...

CheckReporter: Check reporter: 13 line summary of problems

compare: Provide human-readable comparison of two objects

compare_state: Compare two directory states.

comparison-expectations: Expectation: is returned value less or greater than specified...

context: Describe the context of a set of tests.

describe: describe: a BDD testing language

dir_state: Capture the state of a directory.

equality-expectations: Expectation: is the object equal to a value?

evaluate_promise: Evaluate a promise, capturing all types of output.

expectation: Expectation class.

expect_cpp_tests_pass: Test Compiled Code in a Package

expect_equal_to_reference: Expectation: is the object equal to a reference value stored...

expect_length: Expectation: does a vector have the specified length?

expect_match: Expectation: does string/output/message/warning/error match a...

expect_named: Expectation: does object have names?

expect_success: Tools for testing expectations

expect_that: Expect that a condition holds.

fail: Default expectations that alway succeed or fail.

FailReporter: Test reporter: fail at end.

find_reporter: Find reporter object given name or object.

find_test_scripts: Find the test files.

inheritance-expectations: Expectation: does the object inherit from a S3 or S4 class,...

ListReporter: List reporter: gather all test results along with elapsed...

logical-expectations: Expectation: is the object true/false?

make_expectation: Make an equality test.

MinimalReporter: Test reporter: minimal.

MultiReporter: Multi reporter: combine several reporters in one.

not: Negate an expectation

oldskool: Old-style expectations.

output-expectations: Expectation: does code produce output/message/warning/error?

reexports: Objects exported from other packages

Reporter: Stub object for managing a reporter of tests.

reporter-accessors: Get/set reporter; execute code in specified reporter.

RstudioReporter: Test reporter: RStudio

safe_digest: Compute a digest of a filename, returning NA if the file...

SilentReporter: Test reporter: gather all errors silently.

skip: Skip a test.

source_file: Source a file, directory, or all helpers.

StopReporter: Test reporter: stop on error.

SummaryReporter: Test reporter: summary of errors.

takes_less_than: Expectation: does expression take less than a fixed amount of...

TapReporter: Test reporter: TAP format.

TeamcityReporter: Test reporter: Teamcity format.

test_dir: Run all of the tests in a directory.

test_env: Generate default testing environment.

test_examples: Test package examples

test_file: Run all tests in specified file.

test_package: Run all tests in an installed package.

test_path: Locate file in testing directory.

testthat: R package to make testing fun!

test_that: Create a test.

testthat_results: Create a 'testthat_results' object from the test results as...

try_again: Try evaluating an expressing multiple times until it...

use_catch: Use Catch for C++ Unit Testing

watch: Watch a directory for changes (additions, deletions &...

with_mock: Mock functions in a package.

Functions

\%>\% Man page
auto_test Man page
auto_test_package Man page
capture_messages Man page
capture_output Man page
capture_warnings Man page
CheckReporter Man page
compare Man page
compare.character Man page
compare.default Man page
compare.numeric Man page
compare.POSIXt Man page
compare_state Man page
comparison-expectations Man page
context Man page
describe Man page
dir_state Man page
equality-expectations Man page
equals Man page
equals_reference Man page
evaluate_promise Man page
expect Man page
expectation Man page
expect_cpp_tests_pass Man page
expect_equal Man page
expect_equal_to_reference Man page
expect_equivalent Man page
expect_error Man page
expect_failure Man page
expect_false Man page
expect_gt Man page
expect_gte Man page
expect_identical Man page
expect_is Man page
expect_length Man page
expect_less_than Man page
expect_lt Man page
expect_lte Man page
expect_match Man page
expect_message Man page
expect_more_than Man page
expect_named Man page
expect_null Man page
expect_output Man page
expect_output_file Man page
expect_s3_class Man page
expect_s4_class Man page
expect_silent Man page
expect_success Man page
expect_that Man page
expect_true Man page
expect_type Man page
expect_warning Man page
fail Man page
FailReporter Man page
find_reporter Man page
find_test_scripts Man page
get_reporter Man page
gives_warning Man page
has_names Man page
inheritance-expectations Man page
is_a Man page
is_equivalent_to Man page
is.expectation Man page
is_false Man page
is_identical_to Man page
is_less_than Man page
is_more_than Man page
is_null Man page
is_true Man page
ListReporter Man page
logical-expectations Man page
make_expectation Man page
matches Man page
MinimalReporter Man page
MultiReporter Man page
not Man page
oldskool Man page
output-expectations Man page
prints_text Man page
reexports Man page
Reporter Man page
reporter-accessors Man page
RstudioReporter Man page
safe_digest Man page
set_reporter Man page
shows_message Man page
SilentReporter Man page
skip Man page
skip_if_not Man page
skip_if_not_installed Man page
skip_on_appveyor Man page
skip_on_bioc Man page
skip_on_cran Man page
skip_on_os Man page
skip_on_travis Man page
source_dir Man page
source_file Man page
source_test_helpers Man page
StopReporter Man page
succeed Man page
SummaryReporter Man page
takes_less_than Man page
TapReporter Man page
TeamcityReporter Man page
test_check Man page
test_dir Man page
test_env Man page
test_example Man page
test_examples Man page
test_file Man page
test_package Man page
test_path Man page
testthat Man page
test_that Man page
testthat-package Man page
testthat_results Man page
throws_error Man page
try_again Man page
use_catch Man page
watch Man page
with_mock Man page
with_reporter Man page

Files

testthat
testthat/inst
testthat/inst/CITATION
testthat/inst/resources
testthat/inst/resources/test-cpp.R
testthat/inst/resources/test-runner.cpp
testthat/inst/resources/test-example.cpp
testthat/inst/include
testthat/inst/include/testthat.h
testthat/inst/include/testthat
testthat/inst/include/testthat/vendor
testthat/inst/include/testthat/vendor/catch.h
testthat/inst/include/testthat/testthat.h
testthat/tests
testthat/tests/test-catch.R
testthat/tests/testthat.R
testthat/tests/testthat
testthat/tests/testthat/test-evaluate-promise.R
testthat/tests/testthat/test-expect-output.R
testthat/tests/testthat/test-reporter-tap.R
testthat/tests/testthat/test-expect-equal-to-reference.R
testthat/tests/testthat/test-compare-time.R
testthat/tests/testthat/test-expect_that.R
testthat/tests/testthat/test-cpp.R
testthat/tests/testthat/test-label.R
testthat/tests/testthat/test_dir
testthat/tests/testthat/test_dir/test-bare-expectations.R
testthat/tests/testthat/test_dir/test-helper.R
testthat/tests/testthat/test_dir/test-empty.R
testthat/tests/testthat/test_dir/test-skip.R
testthat/tests/testthat/test_dir/test-failures.R
testthat/tests/testthat/test_dir/test-basic.R
testthat/tests/testthat/test_dir/test-errors.R
testthat/tests/testthat/test_dir/helper_hello.R
testthat/tests/testthat/test-test-that.R
testthat/tests/testthat/test-colour.R
testthat/tests/testthat/test-reporter.R
testthat/tests/testthat/test-expect-named.R
testthat/tests/testthat/test-not.R
testthat/tests/testthat/test-path-present
testthat/tests/testthat/test-path-present/tests
testthat/tests/testthat/test-path-present/tests/testthat
testthat/tests/testthat/test-path-present/tests/testthat/empty
testthat/tests/testthat/test-context.R
testthat/tests/testthat/test-reporter-list.R
testthat/tests/testthat/test-expect-length.R
testthat/tests/testthat/test-source_dir.R
testthat/tests/testthat/test-old-school.R
testthat/tests/testthat/test-bare.R
testthat/tests/testthat/test-test_dir.R
testthat/tests/testthat/test-expect-null.R
testthat/tests/testthat/test-path-missing
testthat/tests/testthat/test-path-missing/empty
testthat/tests/testthat/test-compare-character.R
testthat/tests/testthat/test-expect-self-test.R
testthat/tests/testthat/test-expect-warning.R
testthat/tests/testthat/one.rds
testthat/tests/testthat/test-expect-silent.R
testthat/tests/testthat/reporters
testthat/tests/testthat/reporters/silent.txt
testthat/tests/testthat/reporters/tap.txt
testthat/tests/testthat/reporters/teamcity.txt
testthat/tests/testthat/reporters/check.txt
testthat/tests/testthat/reporters/summary.txt
testthat/tests/testthat/reporters/rstudio.txt
testthat/tests/testthat/reporters/tests.R
testthat/tests/testthat/reporters/minimal.txt
testthat/tests/testthat/test-catch.R
testthat/tests/testthat/test-comparisons.R
testthat/tests/testthat/test-helpers.R
testthat/tests/testthat/test-reporter-multi.R
testthat/tests/testthat/test-compare-numeric.R
testthat/tests/testthat/test-describe.R
testthat/tests/testthat/test-test-path.R
testthat/tests/testthat/test-try-again.R
testthat/tests/testthat/test-expect-logical.R
testthat/tests/testthat/test-expect-message.R
testthat/tests/testthat/test-expect-error.R
testthat/tests/testthat/test-expect-inheritance.R
testthat/tests/testthat/test-expect-match.R
testthat/tests/testthat/test-mock.R
testthat/tests/testthat/helper-assign.R
testthat/tests/testthat/test-expect-equality.R
testthat/tests/testthat/test-environment.R
testthat/tests/testthat/context.R
testthat/tests/testthat/test-watcher.R
testthat/src
testthat/src/Makevars
testthat/src/test-runner.cpp
testthat/src/test-example.cpp
testthat/src/test-catch.cpp
testthat/src/Makevars.win
testthat/src/label.c
testthat/src/reassign.c
testthat/NAMESPACE
testthat/NEWS.md
testthat/R
testthat/R/old-school.R testthat/R/reporter.R testthat/R/reporter-check.R testthat/R/test-files.R testthat/R/utils.R testthat/R/expect-named.R testthat/R/expectations-matches.R testthat/R/mock.R testthat/R/reporter-list.R testthat/R/evaluate-promise.R testthat/R/colour-text.R testthat/R/expect-output.R testthat/R/expect-length.R testthat/R/expect-comparison.R testthat/R/expectation.R testthat/R/expect-inheritance.R testthat/R/reporter-teamcity.R testthat/R/compare-numeric.R testthat/R/skip.R testthat/R/test-path.R testthat/R/make-expectation.R testthat/R/auto-test.R testthat/R/test-example.R testthat/R/expect-equal-to-reference.R testthat/R/compare-character.R testthat/R/reporter-multi.R testthat/R/reporter-rstudio.R testthat/R/test-compiled-code.R testthat/R/reporter-stop.R testthat/R/watcher.R testthat/R/reporter-silent.R testthat/R/source.R testthat/R/reporter-tap.R testthat/R/test-that.R testthat/R/compare-time.R testthat/R/try-again.R testthat/R/test-package.R testthat/R/stack.R testthat/R/expect-self-test.R testthat/R/expect-equality.R testthat/R/reporter-summary.R testthat/R/reporter-fail.R testthat/R/compare.R testthat/R/expect-logical.R testthat/R/praise.R testthat/R/expect-that.R testthat/R/reporter-minimal.R testthat/R/describe.R testthat/R/context.R testthat/R/traceback.R testthat/R/reporter-zzz.R
testthat/README.md
testthat/MD5
testthat/DESCRIPTION
testthat/man
testthat/man/FailReporter.Rd testthat/man/test_file.Rd testthat/man/test_path.Rd testthat/man/SilentReporter.Rd testthat/man/try_again.Rd testthat/man/describe.Rd testthat/man/test_package.Rd testthat/man/fail.Rd testthat/man/find_reporter.Rd testthat/man/compare_state.Rd testthat/man/expect_length.Rd testthat/man/make_expectation.Rd testthat/man/equality-expectations.Rd testthat/man/Reporter.Rd testthat/man/TeamcityReporter.Rd testthat/man/test_examples.Rd testthat/man/output-expectations.Rd testthat/man/expect_that.Rd testthat/man/TapReporter.Rd testthat/man/SummaryReporter.Rd testthat/man/expectation.Rd testthat/man/test_env.Rd testthat/man/test_that.Rd testthat/man/RstudioReporter.Rd testthat/man/auto_test_package.Rd testthat/man/takes_less_than.Rd testthat/man/MultiReporter.Rd testthat/man/test_dir.Rd testthat/man/with_mock.Rd testthat/man/MinimalReporter.Rd testthat/man/comparison-expectations.Rd testthat/man/evaluate_promise.Rd testthat/man/auto_test.Rd testthat/man/expect_cpp_tests_pass.Rd testthat/man/reexports.Rd testthat/man/compare.Rd testthat/man/expect_named.Rd testthat/man/dir_state.Rd testthat/man/CheckReporter.Rd testthat/man/expect_success.Rd testthat/man/logical-expectations.Rd testthat/man/expect_equal_to_reference.Rd testthat/man/expect_match.Rd testthat/man/context.Rd testthat/man/testthat.Rd testthat/man/ListReporter.Rd testthat/man/safe_digest.Rd testthat/man/not.Rd testthat/man/reporter-accessors.Rd testthat/man/watch.Rd testthat/man/use_catch.Rd testthat/man/StopReporter.Rd testthat/man/testthat_results.Rd testthat/man/source_file.Rd testthat/man/skip.Rd testthat/man/find_test_scripts.Rd testthat/man/oldskool.Rd testthat/man/inheritance-expectations.Rd
testthat/LICENSE

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.