Skip to contents

Add "biocroxytest::tests_roclet" to the roxygen roclets in DESCRIPTION. Write test bodies in @tests for ordinary tests or @longtests for Bioconductor long tests. Each tag becomes a separate testthat test. Use usethis::use_testthat() and use_longtests() to set up the suites you use. Use @testCases to share a test body across named cases. See test_case_plan(). Use @testexamples to run documented examples before testing their results.

Usage

tests_roclet()

Value

A roxygen2 roclet.

Details

To migrate @tests or @testexamples from roxytest, replace its testthat roclet with this roclet. It retains the roxytest filename prefix and updates ownership headers. Tests in shared @rdname topics follow their original source files, so review any changed test names and snapshot paths after regenerating. Use a single generator for each suite. longtests_roclet() remains available for projects that want only the long test generator.

With custom roclets, use the default clean = FALSE. The generator removes obsolete tests after validating both suites on every run. Test output follows the case-insensitive .Rbuildignore rules. A direct roxygen2 run still uses its configured package loader and may load ignored sources before the test roclet runs.

Examples

tests_roclet()
#> list()
#> attr(,"class")
#> [1] "roclet_biocroxytest_tests" "roclet"