Commit ee36db63 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Update the unit tests of the testsuite feature

parent 3ba9b6f0
...@@ -13,6 +13,7 @@ import Distribution.Package ...@@ -13,6 +13,7 @@ import Distribution.Package
( PackageIdentifier(..), PackageName(..), Dependency(..) ) ( PackageIdentifier(..), PackageName(..), Dependency(..) )
import Distribution.PackageDescription import Distribution.PackageDescription
( PackageDescription(..), BuildInfo(..), TestSuite(..), Library(..) ( PackageDescription(..), BuildInfo(..), TestSuite(..), Library(..)
, TestSuiteInterface(..)
, TestType(..), emptyPackageDescription, emptyBuildInfo, emptyLibrary , TestType(..), emptyPackageDescription, emptyBuildInfo, emptyLibrary
, emptyTestSuite, BuildType(..) ) , emptyTestSuite, BuildType(..) )
import Distribution.Verbosity (silent) import Distribution.Verbosity (silent)
...@@ -47,7 +48,7 @@ suite cabalVersion = TestCase $ do ...@@ -47,7 +48,7 @@ suite cabalVersion = TestCase $ do
, stability = "stable" , stability = "stable"
, description = "Check that Cabal recognizes the Test stanza defined below." , description = "Check that Cabal recognizes the Test stanza defined below."
, category = "PackageTests" , category = "PackageTests"
, descCabalVersion = anyVersion , specVersionRaw = Right anyVersion
, buildType = Just Simple , buildType = Just Simple
, buildDepends = , buildDepends =
[ Dependency (PackageName "base") anyV ] [ Dependency (PackageName "base") anyV ]
...@@ -61,7 +62,7 @@ suite cabalVersion = TestCase $ do ...@@ -61,7 +62,7 @@ suite cabalVersion = TestCase $ do
} }
, testSuites = [ emptyTestSuite , testSuites = [ emptyTestSuite
{ testName = "dummy" { testName = "dummy"
, testType = ExeTest (Version [1,0] []) "dummy.hs" , testInterface = TestSuiteExeV10 (Version [1,0] []) "dummy.hs"
, testBuildInfo = emptyBuildInfo , testBuildInfo = emptyBuildInfo
{ targetBuildDepends = { targetBuildDepends =
[ Dependency (PackageName "base") anyVersion ] [ Dependency (PackageName "base") anyVersion ]
...@@ -75,4 +76,4 @@ suite cabalVersion = TestCase $ do ...@@ -75,4 +76,4 @@ suite cabalVersion = TestCase $ do
(unlines $ map (show . disp) xs) (unlines $ map (show . disp) xs)
in assertEqual depMessage True False in assertEqual depMessage True False
Right (f, _) -> assertEqual "parsed package description does not match anticipated" Right (f, _) -> assertEqual "parsed package description does not match anticipated"
f anticipatedFinalPD f anticipatedFinalPD
\ No newline at end of file
...@@ -26,6 +26,7 @@ import PackageTests.TestStanza.Check ...@@ -26,6 +26,7 @@ import PackageTests.TestStanza.Check
import Distribution.Text (display) import Distribution.Text (display)
import Distribution.Simple.Utils (cabalVersion) import Distribution.Simple.Utils (cabalVersion)
import Data.Version import Data.Version
import System.Directory
hunit :: TestName -> HUnit.Test -> Test hunit :: TestName -> HUnit.Test -> Test
hunit name test = testGroup name $ hUnitTestToTests test hunit name test = testGroup name $ hUnitTestToTests test
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment