View source: R/run_covr_skip_nstf.R
| get_nstf_test_path | R Documentation |
Detects and returns all relevant testing directories used by an R package, combining framework-specific and filesystem-based checks. Supported layouts:
testthat: tests/testthat/
tinytest: inst/tinytest/ (primary location).
Some packages also include a small runner under tests/
(e.g., tests/tinytest.R) which this function does not return
as a path, but it will still detect inst/tinytest/.
testit (standard): tests/testit/
testit (nonstandard): both tests/test-ci/ and
tests/test-cran/ present, using tests/ as the root
base R tests: *.R files directly under tests/
Bioconductor unit tests: inst/unitTests/
get_nstf_test_path(test_pkg_data, testdir)
test_pkg_data |
|
testdir |
|
The function returns a named list of paths for all detected testing setups.
It uses both the flags contained in test_pkg_data and direct filesystem
checks for robustness. If no paths are detected, the returned list contains
a single entry default_tests_root = tests/.
Identical paths arising from multiple detection routes (e.g., tests/ playing
multiple roles) are de-duplicated while preserving the first descriptive label.
If tinytest_dir is provided and relative, it is resolved against the
package root (i.e., dirname(testdir)).
list. A named list of character paths to all applicable test directories found.
Possible names include:
tinytest — inst/tinytest/
testthat — tests/testthat/
testit — tests/testit/
nonstandard_testit_root — tests/ (when both test-ci and test-cran exist)
base_tests_root — tests/ (when base *.R files exist in tests/ root)
bioc_unitTests — inst/unitTests/
default_tests_root — tests/ (returned only if no other paths are detected)
Other nstf_utility:
check_covr_skip_testit(),
create_base_tests_coverage(),
create_nstf_covr_list(),
create_tinytest_coverage(),
get_source_test_mapping_nstf(),
restrict_test_paths_to_framework(),
run_covr_skip_nstf()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.