Open cavediverchris opened 2 years ago
For a project based on Simulink where a test manager will exist the following code made be useful:
function runAllTests()
%projObj = currentProject;
% TODO - Find the test case file tc = 'TestFile.mldatx'; tfObj = sltest.testmanager.load(tc); resultsObj = run(tfObj);
% Generate a report from the results data filePath = 'test_report.pdf'; sltest.testmanager.report(resultsObj,filePath,... 'Author','Test Engineer',... 'IncludeSimulationSignalPlots',true,... 'IncludeComparisonSignalPlots',true); end
As a developer, I want a utility to enable me to easily run all of the unit tests within my project. If I am developing simulink models that are coupled with a Simulink Test Manager this utility will need to use that. For MATLAB code it will need to use the MATLAB unit test framework