MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1
'TestCarpet/testRemainPixels(level=large)'
'TestCarpet/testClass(type=single,level=small)'
'TestCarpet/testClass(type=single,level=medium)'
'TestCarpet/testClass(type=single,level=large)'
'TestCarpet/testClass(type=double,level=small)'
'TestCarpet/testClass(type=double,level=medium)'
'TestCarpet/testClass(type=double,level=large)'
'TestCarpet/testClass(type=uint16,level=small)'
'TestCarpet/testClass(type=uint16,level=medium)'
'TestCarpet/testClass(type=uint16,level=large)'
'TestCarpet/testDefaultL1Output'

The suite had 16 test elements. The element’s Name indicates any parameterization.

suite.run;

Running TestCarpet
..........
......
Done TestCarpet
__________

Run Tests with level Parameter Property Named small

Use the selectIf method of the TestSuite to select test elements that use a particular
parameterization. Select all test elements that use the parameter name small in the
level parameter property list.

s1 = suite.selectIf('ParameterName','small');
{s1.Name}'

ans =

'TestCarpet/testNumel(level=small,side=small)'
'TestCarpet/testRemainPixels(level=small)'
'TestCarpet/testClass(type=single,level=small)'
'TestCarpet/testClass(type=double,level=small)'
'TestCarpet/testClass(type=uint16,level=small)'

The suite has five elements.

s1.run;

Running TestCarpet
.....

33 Unit Testing

Free download pdf