How to create a .cvf file to exclude external m-files from coverage report?
Hi, I’m trying to exclude external m-files coverage from coverage report in Simulink Test. I tried creating coverage filter file refering to https://in.mathworks.com/help/slcoverage/ref/slcoverage.blockselector-class.html
I’m trying to exclude mutiple functions from coverage. Below is my edited script for it.
files = dir(‘*.m’);
for i = 1:length(files)
selector = slcoverage.BlockSelector(slcoverage.BlockSelectorType.BlockInstance, files(i).name);
filt = slcoverage.Filter;
rule = slcoverage.FilterRule(selector, ”, slcoverage.FilterMode.Exclude);
filt.addRule(rule);
end
setFilterName(filt,’MFileExclusion’);
save(filt,’MFileExclusion’)
I tried adding this cvf file to Simulink Test, but its not working. I’m using R2024a.
Is there an issue with the script? Is there any alternate solution here?
Thanks in advance.Hi, I’m trying to exclude external m-files coverage from coverage report in Simulink Test. I tried creating coverage filter file refering to https://in.mathworks.com/help/slcoverage/ref/slcoverage.blockselector-class.html
I’m trying to exclude mutiple functions from coverage. Below is my edited script for it.
files = dir(‘*.m’);
for i = 1:length(files)
selector = slcoverage.BlockSelector(slcoverage.BlockSelectorType.BlockInstance, files(i).name);
filt = slcoverage.Filter;
rule = slcoverage.FilterRule(selector, ”, slcoverage.FilterMode.Exclude);
filt.addRule(rule);
end
setFilterName(filt,’MFileExclusion’);
save(filt,’MFileExclusion’)
I tried adding this cvf file to Simulink Test, but its not working. I’m using R2024a.
Is there an issue with the script? Is there any alternate solution here?
Thanks in advance. Hi, I’m trying to exclude external m-files coverage from coverage report in Simulink Test. I tried creating coverage filter file refering to https://in.mathworks.com/help/slcoverage/ref/slcoverage.blockselector-class.html
I’m trying to exclude mutiple functions from coverage. Below is my edited script for it.
files = dir(‘*.m’);
for i = 1:length(files)
selector = slcoverage.BlockSelector(slcoverage.BlockSelectorType.BlockInstance, files(i).name);
filt = slcoverage.Filter;
rule = slcoverage.FilterRule(selector, ”, slcoverage.FilterMode.Exclude);
filt.addRule(rule);
end
setFilterName(filt,’MFileExclusion’);
save(filt,’MFileExclusion’)
I tried adding this cvf file to Simulink Test, but its not working. I’m using R2024a.
Is there an issue with the script? Is there any alternate solution here?
Thanks in advance. coverage, m file, matlab function MATLAB Answers — New Questions









