1 -- | The steps that can be run by @cabal-validate@.
9 import Data
.Map
.Strict
(Map
)
10 import qualified Data
.Map
.Strict
as Map
12 -- | A step to be run by @cabal-validate@.
21 | SolverBenchmarksTests
23 deriving (Eq
, Enum
, Bounded
, Show)
25 -- | Get the display identifier for a given `Step`.
27 -- This is used to parse the @--step@ command-line argument.
29 -- Note that these names are just kebab-case variants of the `Step` constructor
30 -- names; they do not attempt to describe the steps.
31 displayStep
:: Step
-> String
36 LibTests
-> "lib-tests"
37 LibSuite
-> "lib-suite"
38 LibSuiteExtras
-> "lib-suite-extras"
39 CliTests
-> "cli-tests"
40 CliSuite
-> "cli-suite"
41 SolverBenchmarksTests
-> "solver-benchmarks-tests"
42 SolverBenchmarksRun
-> "solver-benchmarks-run"
44 -- | A map from step names to `Steps`.
46 -- This is an inverse of `displayStep`.
47 nameToStep
:: Map
String Step
50 [ (displayStep step
, step
)
51 | step
<- [minBound .. maxBound]
54 -- | Parse a string as a `Step`.
55 parseStep
:: String -> Maybe Step
56 parseStep step
= Map
.lookup step nameToStep