Un-ignore .bat files
[cabal.git] / cabal-testsuite / PackageTests / TestSuiteTests / ExeV10 / setup-no-markup.test.hs
blobad491f1be56d19463b3873b5a815ef87173b302c
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
24 -- Ensures that even if a .tix file happens to be left around
25 -- markup isn't generated.
26 main = setupAndCabalTest $ do
27 dist_dir <- fmap testDistDir getTestEnv
28 let tixFile = getPath $ tixFilePath (mkPath dist_dir) Vanilla "test-Short"
29 withEnv [("HPCTIXFILE", Just tixFile)] $ do
30 setup_build
31 [ "--enable-tests"
32 , "--ghc-option=-fhpc"
33 , "--ghc-option=-hpcdir"
34 , "--ghc-option=" ++ dist_dir ++ "/hpc/vanilla" ]
35 setup "test" ["test-Short", "--show-details=direct"]
36 shouldNotExist $ getPath (htmlDir (mkPath dist_dir) Vanilla) </> "hpc_index.html"