I am using testthat
to check the code in my package. Some of my tests are for basic functionality, such as constructors and getters. Others are for complex functionality that builds on top of the basic functionality. If the basic tests fail, then it is expected that the complex tests will fail, so there is no point testing further.
Is it possible to:
- Ensure that the basic tests are always done first
- Make a test-failure halt the testing process
To answer your question, I don't think it can be determined other than by having appropriate alphanumeric naming of your
test-*.R
files.From
testthat
source, this is the function which test_package calls, via test_dir, to get the tests:What is wrong with just letting the complex task fail first, anyway?