Commit 58250e4f authored by tibbe's avatar tibbe
Browse files

Fix lots of warning in test code

parent 0c97432f
......@@ -178,4 +178,5 @@ test-suite package-tests
extensible-exceptions,
bytestring,
unix
ghc-options: -Wall
Default-Language: Haskell98
......@@ -17,8 +17,8 @@ import qualified Test.HUnit as HUnit
import PackageTests.BenchmarkExeV10.Check
import PackageTests.BenchmarkOptions.Check
import PackageTests.BenchmarkStanza.Check
import PackageTests.BuildDeps.GlobalBuildDepsNotAdditive1.Check
import PackageTests.BuildDeps.GlobalBuildDepsNotAdditive2.Check
-- import PackageTests.BuildDeps.GlobalBuildDepsNotAdditive1.Check
-- import PackageTests.BuildDeps.GlobalBuildDepsNotAdditive2.Check
import PackageTests.BuildDeps.InternalLibrary0.Check
import PackageTests.BuildDeps.InternalLibrary1.Check
import PackageTests.BuildDeps.InternalLibrary2.Check
......@@ -51,13 +51,12 @@ tests cabalVersion =
-- PackageTests.BuildDeps.GlobalBuildDepsNotAdditive2.Check.suite
, hunit "BuildDeps/InternalLibrary0"
(PackageTests.BuildDeps.InternalLibrary0.Check.suite cabalVersion)
, hunit "TestStanza/" (PackageTests.TestStanza.Check.suite cabalVersion)
, hunit "TestStanza" PackageTests.TestStanza.Check.suite
-- ^ The Test stanza test will eventually be required
-- only for higher versions.
, hunit "TestSuiteExeV10/Test"
(PackageTests.TestSuiteExeV10.Check.checkTest cabalVersion)
, hunit "TestSuiteExeV10/Test" PackageTests.TestSuiteExeV10.Check.checkTest
, hunit "TestSuiteExeV10/TestWithHpc"
(PackageTests.TestSuiteExeV10.Check.checkTestWithHpc cabalVersion)
PackageTests.TestSuiteExeV10.Check.checkTestWithHpc
, hunit "TestOptions" PackageTests.TestOptions.Check.suite
, hunit "BenchmarkStanza"
(PackageTests.BenchmarkStanza.Check.suite cabalVersion)
......
......@@ -24,11 +24,8 @@ import System.FilePath
import System.IO
import System.IO.Error (isDoesNotExistError)
import System.Posix.IO
import System.Process
import System.Process hiding (cwd)
import System.Exit
import Control.Concurrent.Chan
import Control.Concurrent.MVar
import Control.Concurrent
import Control.Monad
import Data.List
import Data.Maybe
......@@ -79,7 +76,7 @@ cabal_configure spec = do
doCabalConfigure :: PackageSpec -> IO Result
doCabalConfigure spec = do
cleanResult@(_, _, cleanOutput) <- cabal spec ["clean"]
cleanResult@(_, _, _) <- cabal spec ["clean"]
requireSuccess cleanResult
ghc <- getGHC
res <- cabal spec $ ["configure", "--user", "-w", ghc] ++ configOpts spec
......
......@@ -10,12 +10,10 @@ import Distribution.PackageDescription.Parse
import Distribution.PackageDescription.Configuration
( finalizePackageDescription )
import Distribution.Package
( PackageIdentifier(..), PackageName(..), Dependency(..) )
( PackageName(..), Dependency(..) )
import Distribution.PackageDescription
( PackageDescription(..), BuildInfo(..), TestSuite(..), Library(..)
, TestSuiteInterface(..)
, TestType(..), emptyPackageDescription, emptyBuildInfo, emptyLibrary
, emptyTestSuite, BuildType(..) )
( PackageDescription(..), BuildInfo(..), TestSuite(..)
, TestSuiteInterface(..), emptyBuildInfo, emptyTestSuite )
import Distribution.Verbosity (silent)
import Distribution.License (License(..))
import Distribution.ModuleName (fromString)
......@@ -24,8 +22,8 @@ import Distribution.Compiler
( CompilerId(..), CompilerFlavor(..) )
import Distribution.Text
suite :: Version -> Test
suite cabalVersion = TestCase $ do
suite :: Test
suite = TestCase $ do
let directory = "PackageTests" </> "TestStanza"
pdFile = directory </> "my" <.> "cabal"
spec = PackageSpec directory []
......
......@@ -5,25 +5,24 @@ module PackageTests.TestSuiteExeV10.Check
import Distribution.PackageDescription ( TestSuite(..), emptyTestSuite )
import Distribution.Simple.Hpc
import Distribution.Version
import Test.HUnit
import PackageTests.PackageTester
import System.Directory
import System.FilePath
import PackageTests.PackageTester
import Test.HUnit
dir :: FilePath
dir = "PackageTests" </> "TestSuiteExeV10"
checkTest :: Version -> Test
checkTest cabalVersion = TestCase $ do
checkTest :: Test
checkTest = TestCase $ do
let spec = PackageSpec dir ["--enable-tests"]
buildResult <- cabal_build spec
assertBuildSucceeded buildResult
testResult <- cabal_test spec []
assertTestSucceeded testResult
checkTestWithHpc :: Version -> Test
checkTestWithHpc cabalVersion = TestCase $ do
checkTestWithHpc :: Test
checkTestWithHpc = TestCase $ do
let spec = PackageSpec dir [ "--enable-tests"
, "--enable-library-coverage"
]
......
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