Result of running test suite
matlab.unittest.TestResult class holds the
information describing the result of running a test suite using the
The results include information describing whether the test passed,
failed, or ran to completion, as well as the duration of each test.
TestResult arrays are created and returned by
the test runner, and are of the same size as the suite which was run.
Time elapsed running test.
Fixture setup time is accounted for in the duration of the first test suite array element that uses the fixture. Fixture teardown time is accounted for in the duration of the last test suite array element that uses the fixture.
The total run time for a suite of tests exceeds the sum of the
durations for all the elements of the suite because the
Logical value showing if test failed.
Fatal assertions are also failing conditions, but in the event
of a fatal assertion failure, the entire framework aborts and a
Logical value showing if test did not run to completion.
Fatal assertions are also conditions that prevent the completion
of tests, but in the event of a fatal assertion failure the entire
framework aborts and a
The name of the
Logical value showing if the test passed.
Create a table from the
for access to
such as sorting rows, displaying a summary, and writing the table
to a file. For example,
rt = table(results);
to the current import list.
Result display method provides a summary of the results
suite = TestSuite.fromClass(?SomeTestClass) results = run(suite)
results = matlab.unittest.TestResult Test Suite Summary: 12 Passed, 4 Failed, 0 Not Run To Completion. 5.5091 seconds testing time.
Rerun only the failed tests.
failedTests = suite([results.Failed]); failedResults = run(failedTests)
failedResults = matlab.unittest.TestResult Test Suite Summary: 0 Passed, 4 Failed, 0 Not Run To Completion. 1.2894 seconds testing time.
Make the fix and rerun results.
newResults = run(failedTests)
newResults = matlab.unittest.TestResult Test Suite Summary: 4 Passed, 0 Failed, 0 Not Run To Completion. 1.1607 seconds testing time.