Skip to content

cabal-testsuite #8401: communicate better the need for --with-cabal #8672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cabal-testsuite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ How to run
1. Build `cabal-testsuite` (`cabal build cabal-testsuite:cabal-tests`)
2. Run the `cabal-tests` executable. It will scan for all tests
in your current directory and subdirectories and run them.
To run a specific set of tests, use `cabal-tests PATH ...`.
(e.g. `cabal run cabal-testsuite:cabal-tests -- cabal-testsuite/PackageTests/TestOptions/setup.test.hs`)
To run a specific set of tests, use `cabal-tests --with-cabal=CABALBIN PATH ...`.
(e.g. `cabal run cabal-testsuite:cabal-tests -- --with-cabal=cabal cabal-testsuite/PackageTests/TestOptions/setup.test.hs`)
You can control parallelism using the `-j` flag.

There are a few useful flags:
Expand Down
4 changes: 2 additions & 2 deletions cabal-testsuite/main/cabal-tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ main = do
-- https://github.com/appveyor/ci/issues/1364
hSetBuffering stderr LineBuffering

-- Parse arguments
args <- execParser (info mainArgParser mempty)
-- Parse arguments. N.B. 'helper' adds the option `--help`.
args <- execParser $ info (mainArgParser <**> helper) mempty
let verbosity = if mainArgVerbose args then verbose else normal

-- To run our test scripts, we need to be able to run Haskell code
Expand Down
10 changes: 7 additions & 3 deletions cabal-testsuite/src/Test/Cabal/Monad.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE ScopedTypeVariables #-}

-- | The test monad
Expand Down Expand Up @@ -72,7 +73,10 @@ import Distribution.Text
import Distribution.Verbosity
import Distribution.Version

import Data.Monoid ((<>), mempty)
#if !MIN_VERSION_base(4,11,0)
import Data.Monoid ((<>))
#endif
import Data.Monoid (mempty)
import qualified Control.Exception as E
import Control.Monad
import Control.Monad.Trans.Reader
Expand Down Expand Up @@ -100,8 +104,8 @@ data CommonArgs = CommonArgs {
commonArgParser :: Parser CommonArgs
commonArgParser = CommonArgs
<$> optional (option str
( help "Path to cabal-install executable to test"
Data.Monoid.<> long "with-cabal"
( help "Path to cabal-install executable to test. If omitted, tests involving cabal-install are skipped!"
<> long "with-cabal"
<> metavar "PATH"
))
<*> optional (option str
Expand Down