Problem Displaying Unit Test Results
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Christopher Shannon
el 29 de Mayo de 2015
Comentada: Andy Campbell
el 29 de Mayo de 2015
I am following the unit test documentation and specifically walking through http://www.mathworks.com/help/matlab/matlab_prog/analyze-testsolver-results.html. I can run the tests for this example and get the correct output.
Running SolverTestClass
..
Done SolverTestClass
__________
res =
1x2 TestResult array with properties:
Name
Passed
Failed
Incomplete
Duration
Totals:
2 Passed, 0 Failed, 0 Incomplete.
0.0074939 seconds testing time.
So, I know that I am correctly returned an array of TestResults. For some reason, converting this array to a table does not provide a display containing the properties of the TestResult class. Instead of the super useful summary table that I'm expecting from the website, I'm getting this instead:
>> rt = table(res)
rt =
res
________________________________
[1x2 matlab.unittest.TestResult]
I've played around quite a bit, but since this is diverging from what seems like such a basic step, I figured that I should post the question. I'm running R2014a, and must be missing something basic...
0 comentarios
Respuesta aceptada
Andy Campbell
el 29 de Mayo de 2015
Hi Christopher,
The table conversion method from TestResult was added in release R2014b, so it just seems you don't have the feature yet.
Hope that helps, Andy
2 comentarios
Andy Campbell
el 29 de Mayo de 2015
Note you can do this a little less conveniently as follows:
t = table(...
{results.Name}', ...
[results.Passed]', ...
[results.Failed]', ...
[results.Incomplete]', ...
[results.Duration]', ...
'VariableNames', {'Name', 'Passed', 'Failed', 'Incomplete', 'Duration'})
That can be wrapped up into your own utility until you have R2014b or after.
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!