Import sim output data from MLDATX that was exported with Unit Test Framework
11 ビュー (過去 30 日間)
古いコメントを表示
With Simulink Test Manager I have created a test file with multiple test suites and test cases.
Signal logging is activated in the test harness model settings.
The test file is then executed using the Matlab Test Framework.
I'm using the TestManagerResultsPlugin to export test results as MLDATX file.
Here's a simple example of how I'm doing it:
import matlab.unittest.TestRunner
import sltest.plugins.TestManagerResultsPlugin
% Create a test runner and add plugins to it
runner = TestRunner.withNoPlugins;
% plugin for creating mldatx results file
addPlugin(runner, TestManagerResultsPlugin(ExportToFile='results.mldatx'));
% Load test suite from Simulink Test Manager file and run it (loads all test cases from all test suites)
allTests = testsuite('anyTestFile.mldatx');
% execute test cases
result = runner.run(allTests);
Next I want to import the MLDATX file programmatically and read the logged signals.
I tried these approaches but neither of them work:
% the following returns a ResultSet object without sim data
results = sltest.testmanager.importResults('results.mldatx');
% this leads to an error: "You are trying to open an exported result file
% as a test file. Use sltest.testmanager.importResults to import result files."
results = sltest.testmanager.load('results.mldatx');
In Simulation Data Inspector I can't open the MLDATX file as well.
In Test Manager UI I can open the file and see the results and logged signal data.
When extracting the MLDATX file with a ZIP tool I can also see that the data is definitely in the file.
My main question: is there any method to programmatically load the logged signal data from the MLDATX file if it was exported by the TestManagerResultsPlugin with Unit Test Framework?
I'm using Matlab 2022b
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Results, Reporting, and Test File Management についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!