testthat: Unit Testing for R

Share:

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

Author
Hadley Wickham [aut, cre], RStudio [cph]
Date of publication
2016-04-23 08:37:40
Maintainer
Hadley Wickham <hadley@rstudio.com>
License
MIT + file LICENSE
Version
1.0.2
URLs

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.

Files in this package

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