Unit test code coverage
2 ビュー (過去 30 日間)
古いコメントを表示
I have a bunch of unittest files that I run using
runtests(pwd,'IncludeSubfolders', true)
I want to know how can I add the code coverage to that line. I read something about 'ReportCoverageFor'but I couldn't use it.
0 件のコメント
回答 (1 件)
Steven Lord
2022 年 6 月 23 日
Add matlab.unittest.plugins.CodeCoveragePlugin to your test runner as shown on this documentation page.
2 件のコメント
Chi
2023 年 1 月 20 日
From the documentation page above,
"runner = testrunner creates a default test runner, which is similar to the runner that the testing framework configures by default when you call the runtests function."
The short answer is that a testrunner is more customizable with additional plugins, see Customize Runner to Generate Test Artifact.
参考
カテゴリ
Help Center および File Exchange で Run Unit Tests についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!