필터 지우기
필터 지우기

How can I combine multiple single run coverage results into a single, cumulative coverage result?

조회 수: 27 (최근 30일)
I have run a series of tests on my model file while collecting individual coverage results for each test. I my coverage folder for my model i now have a large number of CVT coverage data files that I would like to combine into a single coverage report & data file. How can I combine these results into a single file with all of my coverage data?

채택된 답변

MathWorks Support Team
MathWorks Support Team 2024년 7월 29일
편집: MathWorks Support Team 2024년 8월 29일
There are two methods that you can use to combine coverage data: first being done at the command line and the seconds through the coverage Results Explorer UI.
To combine coverage data at the command line, you can use the '+' operator to get the union of the "cvdata" objects:
Please run the below command in the command window of installed MATLAB R2019a version to get release specific documentation:
>> web(fullfile(docroot, 'slcoverage/examples/operations-on-coverage-data.html'))
Alternatively, you can use the coverage Results Explorer to load all of your coverage results for the model from the folder in your screenshot, and combine all of the results into a single cumulative coverage that can be saved. For further details, you can execute the following command in MATLAB R2019a, which covers the same topic.
>> web(fullfile(docroot, 'slcoverage/ug/access-manage-and-accumulate-model-coverage-results.html'))
You can also indicate the need for cumulative coverage collection prior to simulation using the Configuration option under Coverage > Results > Advanced Parameters. Run the below command in the command window of installed MATLAB R2019a version to know more about configuration options. 
>> web(fullfile(docroot, 'slcoverage/ug/cumulative-coverage-data.html'))
Please follow the below link to search for the required information regarding the current release:

추가 답변 (1개)

Kurt Stewart
Kurt Stewart 2021년 6월 2일
편집: Kurt Stewart 2021년 6월 2일
For running unit tests you can combine different test classes into one suite and run them together
suite = testsuite({'UnitTestClass1.m','UnitTestClass2.m'});
runner = TestRunner.withNoPlugins;
runner.addPlugin(CodeCoveragePlugin.forFolder(pwd, ...
'Producing',CoverageReport('TotalCoverage', ...
'MainFile','UnitTests.html')))
runner.run(suite)
pause(1)
web('TotalCoverage/UnitTests.html') %view the results

카테고리

Help CenterFile Exchange에서 Analyze Coverage and View Results에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by