Why do I get a warning that the code coverage result is empty because the file is invalid?
Ältere Kommentare anzeigen
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.
Antworten (2)
Rich006
am 19 Jun. 2024
2 Stimmen
1 Kommentar
Ernst van der Pols
am 5 Jul. 2024
Bearbeitet: Ernst van der Pols
am 5 Jul. 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
am 21 Nov. 2023
0 Stimmen
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!
Kategorien
Mehr zu Spreadsheets finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!