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,
7 #ifndef MIN_VERSION_Cabal
8 #define MIN_VERSION_Cabal
(x
,y
,z
) 1
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
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
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"