Controlling How Tests Are Run
In this chapter, we'll explore configure test execution with command-line options.
Controlling How Tests Are Run
Just as mana run compiles and runs code, mana test compiles code in test mode and runs the resulting test binary.
Running Tests in Parallel or Consecutively
By default, tests run in parallel. To run tests consecutively:
mana test -- --test-threads=1Showing Function Output
By default, output from passing tests is captured. To see output:
mana test -- --show-outputRunning a Subset of Tests
Run a single test by name:
mana test one_hundredRun tests matching a pattern:
mana test addThis runs add_two_and_two, add_three_and_two, etc.
Ignoring Tests
Mark tests to ignore by default:
#[test]
#[ignore]
fn expensive_test() {
// Code that takes a long time
}Run only ignored tests:
mana test -- --ignoredRun all tests including ignored:
mana test -- --include-ignoredContinue to Test Organization.