How can I pass values from inside a TestRunner run?
Afficher commentaires plus anciens
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!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Extend Testing Frameworks dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!