Hi Javier,
As per my knowledge, there isn't a built-in way to include a custom description directly in the table output of the test results or in the HTML report produced. The testing framework focuses on the test results themselves, such as pass/fail status, duration, and diagnostic details.
However, the following workaround is possible:
1) Create a custom function to append descriptions to the results table.
function resultsWithDescription = appendDescriptionsToResults(testResults)
'myClass/addAandB', 'This test check that A plus B is 3';
descriptionsTable = cell2table(descriptions, 'VariableNames', {'Name', 'Description'});
testResultsTable = table(testResults);
resultsWithDescription = outerjoin(testResultsTable, descriptionsTable, 'Keys', 'Name', 'MergeKeys', true);
2) Call this function after running the tests and before displaying the table in the script.
testResults = runner.run(suiteToRun);
testResultsWithDescription = appendDescriptionsToResults(testResults);
disp(testResultsWithDescription);
3) To add description to the HTML report, use the "log" function and the description will appear in the HTML report if the plugin is configured with the "IncludingPassingDiagnostics" option set to "true". (This is already set to true in the script)
methods(Test,TestTags = {'A'})
function y = addAandB(testCase)
testCase.log(matlab.unittest.Verbosity.Detailed, 'This test check that A plus B is 3');
y = testCase.A + testCase.B;
Output of "testResultWithDescription":
HTML report with description:
I hope this workaround was helpful!