Merge pull request #10525 from 9999years/field-stanza-names
[cabal.git] / cabal-testsuite / PackageTests / TestStanza / setup.test.hs
blobf3bc253f002d7a39c904387edc617bc3a965da0c
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-tests"]
16 lbi <- getLocalBuildInfoM
17 let gotTestSuite = head $ testSuites (localPkgDescr lbi)
18 assertEqual "testName" (mkUnqualComponentName "dummy")
19 (testName gotTestSuite)
20 assertEqual "testInterface" (TestSuiteExeV10 (mkVersion [1,0])
21 #if MIN_VERSION_Cabal(3,11,0)
22 $ makeRelativePathEx
23 #endif
24 "dummy.hs")
25 (testInterface gotTestSuite)
26 -- NB: Not testing targetBuildDepends (testBuildInfo gotTestSuite)
27 -- as dependency varies with cabal-install
28 assertEqual
29 "testBuildInfo/hsSourceDirs"
30 [sameDirectory]
31 (hsSourceDirs (testBuildInfo gotTestSuite))
32 return ()