I would like to run tests in the testmanger and export the model outputs so I can parse it and update my baseline spreadsheet with data.
I have tried the script below. but the result of 'getTestCaseResults(tsr)' function does not hold the output data. The only way I can do it right now is righ clicking on the test resulut in the manager and clicking export data.
clear;
sltest.testmanager.clear;
% Define the name of the Simulink model and the test file
modelName = 'brake_control.slx'; % Replace with your model name
testFileName = 'brake_control.mldatx'; % Replace with your test file name
% Load the model
load_system(modelName);
testFile = sltest.testmanager.load(testFileName);
resultsobj = sltest.testmanager.run;
tfr = getTestFileResults(resultsobj);
tsr = getTestSuiteResults(tfr);
tcr = getTestCaseResults(tsr);