Why do I get a warning that the code coverage result is empty because the file is invalid?
Afficher commentaires plus anciens
I'm trying to add code coverage to my unit test suite. There is one .mlapp file that gives this warning:
Warning: Coverage result is empty for /MyPath/myApp.mlapp because the file is invalid.
How can I find out what is wrong with the file? The app works, so I don't know why it would be "invalid." Note: a blank .mlapp file does not give the same warning.
Réponses (2)
Rich006
le 19 Juin 2024
2 votes
1 commentaire
Ernst van der Pols
le 5 Juil 2024
Modifié(e) : Ernst van der Pols
le 5 Juil 2024
I encountered the same problem: a warning with the wrong filename in case of an invalid m-file in the folder that is part of the CodeCoverage.
BUG:
In createFromCodeCoverageCollectorData.m (R2023b) line 21 the filename argument of the warning message for the FAILED files(1) is now staticData{ii}.fileName while it should be files(1).path. (disclamer: seems the logic fix based on my situation).
WORKAROUND:
Put a breakpoint on line 20 in createFromCodeCoverageCollectorData.m and inspect files(1).path of files(1).shortPath to identify the failed file.
Himanshu
le 21 Nov 2023
0 votes
Hey,
I understand that you are trying to add code coverage to a unit test suite.
Please note that producing code coverage reports is not supported with MATLAB Compiler. Since App Designer uses the MATLAB Compiler, producing code coverage reports gives you a warning.
Hope this helps!
Catégories
En savoir plus sur Spreadsheets dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!