Bug 9726 – Add minimum % coverage required for -cov testing

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-14T23:41:00Z
Last change time
2013-03-18T23:36:58Z
Keywords
preapproved
Assigned to
nobody
Creator
bugzilla

Comments

Comment #0 by bugzilla — 2013-03-14T23:41:46Z
This is a management feature. Adding an optional value to the -cov switch: -cov=78 means that the coverage testing must cover 78% or more of the lines, else a non-zero exit status is given when the program is run. Values accepted will be in the range 0..100. This means a minimum coverage "bar" can be set in the build/test system, and automatically tested. The current method requires manually looking at the coverage output, or writing a script to test it, which of course is too much bother and nobody does it. If there are multiple modules under -cov, each must meet the bar.
Comment #1 by issues.dlang — 2013-03-15T10:56:27Z
Oooh. Nice idea.
Comment #2 by bugzilla — 2013-03-15T14:54:21Z
For example, dmd test.d -unittest -cov=90 -run should compile and run the unittests in test.d, and the program should fail if it doesn't have at least 90% coverage.
Comment #3 by bugzilla — 2013-03-17T15:45:53Z
Comment #4 by github-bugzilla — 2013-03-18T14:17:59Z
Commits pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/453e4b461a36f751e27caab84dd76679021bca16 fix Issue 9726 - Add minimum % coverage required for -cov testing https://github.com/D-Programming-Language/druntime/commit/6e298fd4c6dde94c646cfac91dd514787ed3179c Merge pull request #450 from WalterBright/fix9726 fix Issue 9726 - Add minimum % coverage required for -cov testing
Comment #5 by github-bugzilla — 2013-03-18T23:36:58Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/9064bbb2366265aa87a99105429b5f8798ae6638 fix Issue 9726 - Add minimum % coverage required for -cov testing https://github.com/D-Programming-Language/dmd/commit/9c78bb2ec4fdc1b44858f31d514d6370a824612b Merge pull request #1759 from WalterBright/fix9726 fix Issue 9726 - Add minimum % coverage required for -cov testing