(cabal check) Add "No internal name clash" test
[cabal.git] / cabal-testsuite / PackageTests / BenchmarkStanza / setup.test.hs
blobeee6c0dd269eb8c91f39d62f96b69e33419e674e
1 import Test.Cabal.Prelude
3 import Distribution.Version
4 import Distribution.Simple.LocalBuildInfo
5 import Distribution.Package
6 import Distribution.PackageDescription
7 import Distribution.Types.UnqualComponentName
8 import Control.Monad.IO.Class
9 import Distribution.Simple.Configure
10 import Distribution.Utils.Path
12 main = setupAndCabalTest $ do
13 assertOutputDoesNotContain "unknown section type"
14 =<< setup' "configure" ["--enable-benchmarks"]
15 lbi <- getLocalBuildInfoM
16 let gotBenchmark = head $ benchmarks (localPkgDescr lbi)
17 assertEqual "benchmarkName"
18 (mkUnqualComponentName "dummy")
19 (benchmarkName gotBenchmark)
20 assertEqual "benchmarkInterface"
21 (BenchmarkExeV10 (mkVersion [1,0]) "dummy.hs")
22 (benchmarkInterface gotBenchmark)
23 -- NB: Not testing targetBuildDepends (benchmarkBuildInfo gotBenchmark),
24 -- as the dependency varies with cabal-install
25 assertEqual
26 "benchmarkBuildInfo/hsSourceDirs"
27 [sameDirectory]
28 (hsSourceDirs (benchmarkBuildInfo gotBenchmark))
29 return ()