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@.
23 | SolverBenchmarksTests
26 deriving (Eq
, Enum
, Bounded
, Show)
28 -- | Get the display identifier for a given `Step`.
30 -- This is used to parse the @--step@ command-line argument.
32 -- Note that these names are just kebab-case variants of the `Step` constructor
33 -- names; they do not attempt to describe the steps.
34 displayStep
:: Step
-> String
37 PrintConfig
-> "print-config"
38 PrintToolVersions
-> "print-tool-versions"
41 LibTests
-> "lib-tests"
42 LibSuite
-> "lib-suite"
43 LibSuiteExtras
-> "lib-suite-extras"
44 CliTests
-> "cli-tests"
45 CliSuite
-> "cli-suite"
46 SolverBenchmarksTests
-> "solver-benchmarks-tests"
47 SolverBenchmarksRun
-> "solver-benchmarks-run"
48 TimeSummary
-> "time-summary"
50 -- | A map from step names to `Steps`.
52 -- This is an inverse of `displayStep`.
53 nameToStep
:: Map
String Step
56 [ (displayStep step
, step
)
57 | step
<- [minBound .. maxBound]
60 -- | Parse a string as a `Step`.
61 parseStep
:: String -> Maybe Step
62 parseStep step
= Map
.lookup step nameToStep