Un-ignore .bat files
[cabal.git] / cabal-testsuite / PackageTests / TestSuiteTests / ExeV10 / setup-no-tix.test.hs
blob7fa7fbe9b1945537bf1cfc42e61c4a6b937b3775
1 {-# LANGUAGE CPP #-}
3 -- The logic here is tricky.
4 -- If this is compiled by cabal-install, then the MIN_VERSION_Cabal is set
5 -- otherwise, we are compiling against Cabal library under test,
6 -- which is new!
7 #ifndef MIN_VERSION_Cabal
8 #define MIN_VERSION_Cabal(x,y,z) 1
9 #endif
11 import Test.Cabal.Prelude
12 import Distribution.Simple.Hpc
13 #if MIN_VERSION_Cabal(3,11,0)
14 import Distribution.Utils.Path
15 ( unsafeMakeSymbolicPath, getSymbolicPath )
16 mkPath = unsafeMakeSymbolicPath
17 getPath = getSymbolicPath
18 #else
19 mkPath = id
20 getPath = id
21 #endif
23 -- When -fhpc is manually provided, but --enable-coverage is not,
24 -- the desired behavior is that we pass on -fhpc to GHC, but do NOT
25 -- attempt to do anything with the tix file (i.e., do not change
26 -- where it gets output, do not attempt to run hpc on it.)
28 -- This was requested in #1945, by a user who wanted to handle the
29 -- coverage manually. Unfortunately, this behavior is (not yet)
30 -- documented in the manual. (In fact, coverage is not documented
31 -- at all.)
33 main = setupAndCabalTest $ do
34 dist_dir <- fmap testDistDir getTestEnv
35 setup_build
36 [ "--enable-tests"
37 , "--ghc-option=-fhpc"
38 , "--ghc-option=-hpcdir"
39 , "--ghc-option=" ++ dist_dir ++ "/hpc/vanilla" ]
40 setup "test" ["test-Short", "--show-details=direct"]
41 lbi <- getLocalBuildInfoM
42 let way = guessWay lbi
43 shouldNotExist $ getPath $ tixFilePath (mkPath dist_dir) way "test-Short"