hpc-threshold-0.1.0.3: Ensure the code coverage is above configured thresholds

Safe HaskellNone
LanguageHaskell2010

HPCThreshold

Synopsis

Documentation

type ThresholdEvaluationResult = (Threshold, Coverage, Bool) Source #

The result of evaluation. The _3 indicates whether the coverage passes the threshold or not.

extractCoverage Source #

Arguments

:: String

The input string

-> ByteString

The regex to extract the coverage. The regex should contain `(\d+)` capture otherwise the coverage is always be 0.

-> Coverage

The extracted coverage

Extract the coverage from input string using a regex string

evaluate :: String -> Threshold -> ThresholdEvaluationResult Source #

Evaluate the given string against the given threshold, producing an evaluation result

reportThreshold :: ThresholdEvaluationResult -> String Source #

Produce a human-friendly output of the evaluation result

evaluateAndReport Source #

Arguments

:: String

The input string

-> [Threshold]

The list of thresholds

-> (String, Bool)

Pair of report and whether there is any coverage under thresholds

Evaluate a string against a list of thresholds configuration and produce a report