1 import Test
.Cabal
.Prelude
3 -- Test that build-tool-depends executables are correctly provisioned
4 -- in all circumstances.
6 mpkgdb
<- testPackageDbPath
<$> getTestEnv
8 -- This test can only be run using the in-tree Cabal library because
9 -- Cabal-hooks isn't available in any package database (GHC isn't yet
10 -- shipped with a version of Cabal with SetupHooks).
11 -- Ever since 716b109c4ae908458b16af5d75c233c7d9fdfc06, we use --intree-cabal-lib in
12 -- CI, so we should always take the "Just" case which actually runs the test.
14 -- NB: be sure to use v2 commands, as otherwise the testsuite driver will not
15 -- pass --package-db flags.
16 Nothing
-> skip
"Cabal-hooks library unavailable."
17 Just _pkgdb
-> recordMode DoNotRecord
$ do
20 -- - in a pre-build hook
21 -- - in a Template Haskell splice
22 cabal
"v2-build" [ "all", "--enable-tests", "--enable-benchmarks"]
23 -- At runtime of a test-suite
24 cabal
"v2-test" [ "pbts" ]
25 -- At runtime of a benchmark
26 cabal
"v2-bench" [ "pbts" ]
27 -- At runtime of an executable
28 cabal
"v2-run" [ "pbts-exe" ]