Show complete error table using verifyEqual (from Unit Testing)
4 次查看(过去 30 天)
显示 更早的评论
Is there a way to get the failure table to display all the failures? I couldn't find any flags in the documentation to control that.
For example:
testCase = matlab.unittest.TestCase.forInteractiveUse; % Creates an interactive test object
verifyEqual(testCase,5,5) % Passes the test
verifyEqual(testCase,randn(50,1),randn(50,1)) % Fails the test, shows the complete error table
verifyEqual(testCase,randn(500,1),randn(500,1)) % Fails the tests, shows the first 50 of 500 failures.
0 个评论
采纳的回答
Andy Campbell
2015-8-11
编辑:Andy Campbell
2015-8-11
There is currently no way to show all the indices in the failure table when the array has more than 50 failing indices.
I am interested in hearing about when you want them. The output is trimmed because more than 50 failing indices (yes I know 50 is arbitrary) can be a burden to debug and printing a plethora of output is often not helpful.
Do you see yourself looking at all of them? What happens if you have a million element array and all indices failed by the same value e.g.
verifyEqual(ones(1,1e6), ones(1,1e6)+1)
Can you provide some details on the scenario you face where you would like all of this output?
Thanks, Andy
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Run Unit Tests 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!