How is the execution order defined between multiple tests within matlab.unittest.TestCase.run?
2 Comments
Answers (1)
Hi William,
The order is not guaranteed by design. This is so that the tests can follow the principle of Independent Test. By prinicple, each test should be independently runnable on its own, which allwos for the tests to be easily reproducible when failures are encountered, and any subsetof a test suite can be run. It also facilitates running them in parallel.
If there were a guaranteed order of tests, then tests would begin depending on one another which would result in an inability to run them each independently. Test B would not pass without first running Test A and so forth.
If you'd like a defined order it sounds more like an integration or system test, which should be written in a single test method.
Hope that helps! Andy
4 Comments
See Also
Categories
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!