Un-ignore .bat files
[cabal.git] / cabal-testsuite / PackageTests / BenchmarkStanza / setup.test.hs
blob1dfd90ae86a9da04d902e9bc324c39ee0895fe51
1 {-# LANGUAGE CPP #-}
2 import Test.Cabal.Prelude
4 import Distribution.Version
5 import Distribution.Simple.LocalBuildInfo
6 import Distribution.Package
7 import Distribution.PackageDescription
8 import Distribution.Types.UnqualComponentName
9 import Control.Monad.IO.Class
10 import Distribution.Simple.Configure
11 import Distribution.Utils.Path
13 main = setupAndCabalTest $ do
14 assertOutputDoesNotContain "unknown section type"
15 =<< setup' "configure" ["--enable-benchmarks"]
16 lbi <- getLocalBuildInfoM
17 let gotBenchmark = head $ benchmarks (localPkgDescr lbi)
18 assertEqual "benchmarkName"
19 (mkUnqualComponentName "dummy")
20 (benchmarkName gotBenchmark)
21 assertEqual "benchmarkInterface"
22 (BenchmarkExeV10 (mkVersion [1,0])
23 #if MIN_VERSION_Cabal(3,11,0)
24 $ makeRelativePathEx
25 #endif
26 "dummy.hs")
27 (benchmarkInterface gotBenchmark)
28 -- NB: Not testing targetBuildDepends (benchmarkBuildInfo gotBenchmark),
29 -- as the dependency varies with cabal-install
30 assertEqual
31 "benchmarkBuildInfo/hsSourceDirs"
32 [sameDirectory]
33 (hsSourceDirs (benchmarkBuildInfo gotBenchmark))
34 return ()