tc = sltest.testmanager.addTestsForMissingCoverage(testOpts,cvData)
creates a TestCase object that increases the test coverage in
cvData using the test options specified by the TestOptions object,
testOpts. You must have a Simulink®
Design Verifier™ license to use this function.
This example shows how increase coverage when coverage results for a test case are lower than 100%.
Get the existing test case from the test file and then run the test and get the coverage data. Create a TestOptions object and add missing coverage to the coverage data for new test case. Run the new test case and open the Test Manager.
In the Results and Artifacts panel in the Test Manager, select the first Results. In the Aggregated Coverage Results section, the coverage is less than 100%.
Now, select the second Results. In the Aggregated Coverage Results section, the coverage increased to 100%.
Coverage data, specified as the path to the cvdata object from
the test with missing coverage. For example, suppose that you have a test case,
tc, that you run to get the coverage data from the test results,
tr. Use getcoverageResults to get the coverage
data:
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.