How to pass additional data to testresults of unittest inside testmethod of matlab.unittest.TestCase in 2019b
Show older comments
Hello I`m searching for the best way adding data to test results. The aim is to add additional information to the results of a testmethod in a way that i can apply easily further evaluation on all testresult data. For example Im testing with image_data in a testcase class TestMyImageData < matlab.unittest.TestCase and I'm using the factory method to create the suite = matlab.unittest.TestSuite.fromClass(?TestMyImageData, 'ExternalParameters',param). While param holds various images data. After testrun I would like to be able to make further operations on testresult data:
create_my_figure_for_analysis([testresults.Details])
Im not interested in any figure creation and logging to files while testrun. I would like to decide afterwards what I plot or analyze based on the data I specified to go with the testresult of a testmethod. Maybe something like the following:
function test_my_stuff(testCase)
...
testCase.addToResults('Names',ImageName,'Difference',difference)
testCase.verifyLessThan(difference, MY_EXPECTED_DIFF)
end
...
results = runner.run()
results(1).Details.Difference
Accepted Answer
More Answers (0)
Categories
Find more on Hypothesis Tests in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!