When a baseline test fails, how can I show only the signals that failed the criteria in the generated report?

2 views (last 30 days)
I have a Simulink model that contains many signals in a bus. I am using Simulink Test to validate the signal values within a bus, and I am generating a report to view the results of the test. However, the resulting document takes a long time to be generated, and is filled with many signals that passed the criteria test.
As such, to both shorten the time it takes to generate the report, and make the report easier to read, I would like to only show the signals that fail a criteria test. How can I do this?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 29 Dec 2021
To accomplish this in R2021b, you will need to define a custom class that inherits from the "sltest.testmanager.TestResultReport" class.  An enhancement request has been submitted to have an option to do this within the Test Manager's interface instead.
This can be done by performing the following steps:
1. Create a new folder, and name it "@CustomClassName", where "CustomClassName" can be whatever you would like to name your class. Replace with all other references to "CustomClassName".
2. Enter this folder, then create two files: "CustomClassName.m" and "genSignalSummaryTable.m". 
3. In "CustomClassName.m", add the following code:
% @CustomClassName/CustomClassName.m:
classdef CustomClassName< sltest.testmanager.TestResultReport
    methods
        function this = CustomClassName(resultObjects, reportFilePath)
            this@sltest.testmanager.TestResultReport(resultObjects, reportFilePath);
        end
    end
    
    methods(Access=protected)
        docPart = genSignalSummaryTable(obj,signalList,isComparison,isSummaryTable);
    end
end
4. In the Command Window, execute the following:
>> edit sltest.testmanager.TestResultReport.genSignalSummaryTable
5. In the window that opens, copy the contents of "genSignalSummaryTable.m" into the file of the same name that you created.
6. Within this file, the variable 'entryList' is what stores each signal which is appended as a row in the report. The "genTableEntriesForSignalSummary" function (within this file) generates the value for this variable. By changing the logic in lines 79-86 & 185-192 of this file, you can prevent passing signals from being added to the report. 
Please refer to the documentation page for customizing test results reports for further information on this workflow.

More Answers (0)

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!