How can I pass values from inside a TestRunner run?
이전 댓글 표시
hi,
I have a class inheriting from matlab.unittest.TestCase. This class runs through various test functions (test1, test2) which utilize matlab's unittest qualification methods. I'm recreating the class and running 'foo' for each idx.
However, I want to run some statistics on the data ITSELF across idx. This means , I need some way of either storing or passing 'MyData' for each run outside.
I thought about saving it locally and using it afterwards, but I would like something built-in.
classdef MyTest < matlab.unittest.TestCase
properties (ClassSetupParameter)
idx = num2cell(1:3);
end
properties
MyData;
end
methods(TestClassSetup)
function runfoo(testCase,idx)
testCase.MyData = foo(testCase,idx);
end
end
methods(Test)
function runtestsonfoo(testCase)
test1(testCase);
test2(testCaes);
end
end
end
Thank you!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Extend Testing Frameworks에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!