MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1
res

res =

1×3 TestResult array with properties:

Name
Passed
Failed
Incomplete
Duration
Details

Totals:
1 Passed, 1 Failed, 1 Incomplete.
2.4807 seconds testing time.

The testing framework keeps track of incomplete tests so that you can monitor filtered
tests for nonexercised test code. You can see information about these tests within the
TestResult object.

res([res.Incomplete])

ans =

TestResult with properties:

Name: 'ExampleTest/testB'
Passed: 0
Failed: 0
Incomplete: 1
Duration: 2.2578
Details: [1×1 struct]

Totals:
0 Passed, 0 Failed, 1 Incomplete.
2.2578 seconds testing time.

To create a modified test suite from only the filtered tests, select incomplete tests from
the original test suite.

tsFiltered = ts([res.Incomplete])

tsFiltered =

33 Unit Testing

Free download pdf