Unit test code coverage

11 views (last 30 days)
Mohamed AKI Ahmed
Mohamed AKI Ahmed on 23 Jun 2022
Commented: Mohamed AKI Ahmed on 23 Jun 2022
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.

Answers (1)

Steven Lord
Steven Lord on 23 Jun 2022
Add matlab.unittest.plugins.CodeCoveragePlugin to your test runner as shown on this documentation page.
  1 Comment
Mohamed AKI Ahmed
Mohamed AKI Ahmed on 23 Jun 2022
what's the differance between the test runner and runtests? which one is better to use?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!