
#14711: Machine readable output of coverage -------------------------------------+------------------------------------- Reporter: Koterpillar | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: Component: Code Coverage | Version: 8.2.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- When integrating with a CI system, it might be useful to fail the build, alert or take other actions based on coverage percentage. To do that, hpc needs to output a summary coverage report in a machine readable format. For example, the current output: {{{ 38% expressions used (1779/4624) 57% boolean coverage (16/28) 56% guards (9/16), 6 always True, 1 always False 58% 'if' conditions (7/12), 2 always False, 3 unevaluated 100% qualifiers (0/0) 7% alternatives used (103/1410) 75% local declarations used (102/136) 40% top-level declarations used (185/457) }}} can be represented as: {{{ { expressions: { total: 4624, used: 1779, percentage: 0.38 }, boolean: { total: 28, used: 16, percentage: 0.57 }, <...> } }}} This output can be then parsed to decide whether to fail the build, produce a coverage graph over time, etc. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14711 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler