Skip to content

Commit

Permalink
Add --tasty-arg to validate.sh
Browse files Browse the repository at this point in the history
This lets you add custom arguments to `Tasty` test suites. This can be
used to set `--keep-tmp-files` for debugging, or to run a particular
test in `cabal-testsuite`:

    ./validate.sh -v -s build -s cli-suite \
        --tasty-arg PackageTests/HaddockKeepTmpsCustom/cabal.test.hs
  • Loading branch information
9999years authored and Mikolaj committed Oct 12, 2024
1 parent 3dcc771 commit 92466c7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions cabal-validate/src/Cli.hs
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,11 @@ resolveOpts opts = do

tastyArgs' =
"--hide-successes"
: case rawTastyPattern opts of
Just tastyPattern -> ["--pattern", tastyPattern]
Nothing -> []
: maybe
[]
(\tastyPattern -> ["--pattern", tastyPattern])
(rawTastyPattern opts)
++ rawTastyArgs opts

when (rawListSteps opts) $ do
-- TODO: This should probably list _all_ available steps, not just the selected ones!
Expand Down Expand Up @@ -279,6 +281,7 @@ data RawOpts = RawOpts
, rawCabal :: FilePath
, rawExtraCompilers :: [FilePath]
, rawTastyPattern :: Maybe String
, rawTastyArgs :: [String]
, rawDoctest :: Bool
, rawSteps :: [Step]
, rawListSteps :: Bool
Expand Down Expand Up @@ -343,6 +346,12 @@ rawOptsParser =
<> help "Pattern to filter tests by"
<> value Nothing
)
<*> many
( strOption
( long "tasty-arg"
<> help "Extra arguments to pass to Tasty test suites"
)
)
<*> boolOption
False
"doctest"
Expand Down

0 comments on commit 92466c7

Please sign in to comment.