4 patches for repository /home/ttuegel/repos/cabal-head: Mon Jan 10 09:46:57 CST 2011 Thomas Tuegel * Moved map functions for CondTree to declaration of type. Previously, the functions were used only in Distribution.PackageDescription.Configuration, and so were defined there. It makes more sense for them to reside with the declaration of CondTree in Distribution.PackageDescription, and they will soon be used in Distribution.Simple.Configure. Mon Jan 10 11:42:27 CST 2011 Thomas Tuegel * Tracking enabled/disabled TestSuites in PackageDescription. This patch adds the 'testEnabled' field to TestSuite. It's undesirable to track build status information in the static package description, but there is no better solution at this time. This patch has the side-effect of fixing several TODOs in Distribution.Simple.Configure. Tue Jan 11 10:27:19 CST 2011 Thomas Tuegel * Added other-modules for unit-tests to Cabal.cabal. Tue Jan 11 10:43:04 CST 2011 Thomas Tuegel * Support for building libraries and test suites with HPC; automatic markup generation. New patches: [Moved map functions for CondTree to declaration of type. Thomas Tuegel **20110110154657 Ignore-this: bd508940159b32c16f97eb06db330d78 Previously, the functions were used only in Distribution.PackageDescription.Configuration, and so were defined there. It makes more sense for them to reside with the declaration of CondTree in Distribution.PackageDescription, and they will soon be used in Distribution.Simple.Configure. ] { hunk ./Distribution/PackageDescription.hs 105 GenericPackageDescription(..), Flag(..), FlagName(..), FlagAssignment, CondTree(..), ConfVar(..), Condition(..), + mapCondTree, mapTreeData, mapTreeConds, mapTreeConstrs, -- * Source repositories SourceRepo(..), hunk ./Distribution/PackageDescription.hs 874 } deriving (Show, Eq) +mapCondTree :: (a -> b) -> (c -> d) -> (Condition v -> Condition w) + -> CondTree v c a -> CondTree w d b +mapCondTree fa fc fcnd (CondNode a c ifs) = + CondNode (fa a) (fc c) (map g ifs) + where + g (cnd, t, me) = (fcnd cnd, mapCondTree fa fc fcnd t, + fmap (mapCondTree fa fc fcnd) me) + +mapTreeConstrs :: (c -> d) -> CondTree v c a -> CondTree v d a +mapTreeConstrs f = mapCondTree id f id + +mapTreeConds :: (Condition v -> Condition w) -> CondTree v c a -> CondTree w c a +mapTreeConds f = mapCondTree id id f + +mapTreeData :: (a -> b) -> CondTree v c a -> CondTree v c b +mapTreeData f = mapCondTree f id id + --instance (Text v, Text c) => Text (CondTree v c a) where -- disp (CondNode _dat cs ifs) = -- (text "build-depends: " <+> hunk ./Distribution/PackageDescription/Configuration.hs 67 ( GenericPackageDescription(..), PackageDescription(..) , Library(..), Executable(..), BuildInfo(..) , Flag(..), FlagName(..), FlagAssignment - , CondTree(..), ConfVar(..), Condition(..), TestSuite(..) ) + , CondTree(..), ConfVar(..), Condition(..), TestSuite(..) + , mapTreeData, mapTreeConds, mapTreeConstrs ) import Distribution.Version ( VersionRange, anyVersion, intersectVersionRanges, withinRange ) import Distribution.Compiler hunk ./Distribution/PackageDescription/Configuration.hs 188 ------------------------------------------------------------------------------ -mapCondTree :: (a -> b) -> (c -> d) -> (Condition v -> Condition w) - -> CondTree v c a -> CondTree w d b -mapCondTree fa fc fcnd (CondNode a c ifs) = - CondNode (fa a) (fc c) (map g ifs) - where - g (cnd, t, me) = (fcnd cnd, mapCondTree fa fc fcnd t, - fmap (mapCondTree fa fc fcnd) me) - -mapTreeConstrs :: (c -> d) -> CondTree v c a -> CondTree v d a -mapTreeConstrs f = mapCondTree id f id - -mapTreeConds :: (Condition v -> Condition w) -> CondTree v c a -> CondTree w c a -mapTreeConds f = mapCondTree id id f - -mapTreeData :: (a -> b) -> CondTree v c a -> CondTree v c b -mapTreeData f = mapCondTree f id id - -- | Result of dependency test. Isomorphic to @Maybe d@ but renamed for -- clarity. data DepTestRslt d = DepOk | MissingDeps d } [Tracking enabled/disabled TestSuites in PackageDescription. Thomas Tuegel **20110110174227 Ignore-this: 412a5fdbef2dc7fbc7dc698c86917e5e This patch adds the 'testEnabled' field to TestSuite. It's undesirable to track build status information in the static package description, but there is no better solution at this time. This patch has the side-effect of fixing several TODOs in Distribution.Simple.Configure. ] { hunk ./Distribution/PackageDescription.hs 86 hasTests, withTest, testModules, + enabledTests, -- * Build information BuildInfo(..), hunk ./Distribution/PackageDescription.hs 380 data TestSuite = TestSuite { testName :: String, testInterface :: TestSuiteInterface, - testBuildInfo :: BuildInfo + testBuildInfo :: BuildInfo, + testEnabled :: Bool + -- TODO: By having a 'testEnabled' field in the PackageDescription, we + -- are mixing build status information (i.e., arguments to 'configure') + -- with static package description information. This is undesirable, but + -- a better solution is waiting on the next overhaul to the + -- GenericPackageDescription -> PackageDescription resolution process. } deriving (Show, Read, Eq) hunk ./Distribution/PackageDescription.hs 420 mempty = TestSuite { testName = mempty, testInterface = mempty, - testBuildInfo = mempty + testBuildInfo = mempty, + testEnabled = False } mappend a b = TestSuite { hunk ./Distribution/PackageDescription.hs 427 testName = combine' testName, testInterface = combine testInterface, - testBuildInfo = combine testBuildInfo + testBuildInfo = combine testBuildInfo, + testEnabled = if testEnabled a then True else testEnabled b } where combine field = field a `mappend` field b combine' f = case (f a, f b) of hunk ./Distribution/PackageDescription.hs 449 hasTests :: PackageDescription -> Bool hasTests = any (buildable . testBuildInfo) . testSuites +-- | Get all the enabled test suites from a package. +enabledTests :: PackageDescription -> [TestSuite] +enabledTests = filter testEnabled . testSuites + -- | Perform an action on each buildable 'TestSuite' in a package. withTest :: PackageDescription -> (TestSuite -> IO ()) -> IO () withTest pkg_descr f = hunk ./Distribution/PackageDescription.hs 456 - mapM_ f $ filter (buildable . testBuildInfo) $ - testSuites pkg_descr + mapM_ f $ filter (buildable . testBuildInfo) $ enabledTests pkg_descr -- | Get all the module names from a test suite. testModules :: TestSuite -> [ModuleName] hunk ./Distribution/PackageDescription/Configuration.hs 222 -- This would require some sort of SAT solving, though, thus it's not -- implemented unless we really need it. -- -resolveWithFlags :: Monoid a => +resolveWithFlags :: [(FlagName,[Bool])] -- ^ Domain for each flag name, will be tested in order. -> OS -- ^ OS as returned by Distribution.System.buildOS hunk ./Distribution/PackageDescription/Configuration.hs 229 -> Arch -- ^ Arch as returned by Distribution.System.buildArch -> CompilerId -- ^ Compiler flavour + version -> [Dependency] -- ^ Additional constraints - -> [CondTree ConfVar [Dependency] a] + -> [CondTree ConfVar [Dependency] PDTagged] -> ([Dependency] -> DepTestRslt [Dependency]) -- ^ Dependency test function. hunk ./Distribution/PackageDescription/Configuration.hs 231 - -> Either [Dependency] (TargetSet a, FlagAssignment) + -> Either [Dependency] (TargetSet PDTagged, FlagAssignment) -- ^ Either the missing dependencies (error case), or a pair of -- (set of build targets with dependencies, chosen flag assignments) resolveWithFlags dom os arch impl constrs trees checkDeps = hunk ./Distribution/PackageDescription/Configuration.hs 379 -- | Combine the target-specific dependencies in a TargetSet to give the -- dependencies for the package as a whole. -overallDependencies :: Monoid a => TargetSet a -> DependencyMap +overallDependencies :: TargetSet PDTagged -> DependencyMap overallDependencies (TargetSet targets) = mconcat depss where hunk ./Distribution/PackageDescription/Configuration.hs 382 - (depss, _) = unzip targets + (depss, _) = unzip $ filter (removeDisabledTests . snd) targets + removeDisabledTests :: PDTagged -> Bool + removeDisabledTests (Lib _) = True + removeDisabledTests (Exe _ _) = True + removeDisabledTests (Test _ t) = testEnabled t + removeDisabledTests PDNull = True -- Apply extra constraints to a dependency map. -- Combines dependencies where the result will only contain keys from the left hunk ./Distribution/PackageDescription/PrettyPrint.hs 180 $+$ ppFields binfoFieldDescrs (testBuildInfo testsuite) $+$ ppCustomFields (customFieldsBI (testBuildInfo testsuite)) - ppTestSuite (TestSuite _ _ buildInfo') - (Just (TestSuite _ _ buildInfo2)) = + ppTestSuite (TestSuite _ _ buildInfo' _) + (Just (TestSuite _ _ buildInfo2 _)) = ppDiffFields binfoFieldDescrs buildInfo' buildInfo2 $+$ ppCustomFields (customFieldsBI buildInfo') hunk ./Distribution/Simple/Configure.hs 85 ( PackageDescription(..), specVersion, GenericPackageDescription(..) , Library(..), hasLibs, Executable(..), BuildInfo(..), allExtensions , HookedBuildInfo, updatePackageDescription, allBuildInfo - , FlagName(..), TestSuite(..) ) + , FlagName(..), TestSuite(..), mapTreeData ) import Distribution.PackageDescription.Configuration hunk ./Distribution/Simple/Configure.hs 87 - ( finalizePackageDescription, flattenPackageDescription ) + ( finalizePackageDescription ) import Distribution.PackageDescription.Check ( PackageCheck(..), checkPackage, checkPackageFiles ) import Distribution.Simple.Program hunk ./Distribution/Simple/Configure.hs 321 not . null . PackageIndex.lookupDependency pkgs' where pkgs' = PackageIndex.insert internalPackage installedPackageSet - pkg_descr0'' = - --TODO: avoid disabling tests entirely, we otherwise cannot - -- perform semantic checks, see also checkPackageProblems - if fromFlag (configTests cfg) - then pkg_descr0 - else pkg_descr0 { condTestSuites = [] } + enableTest t = t { testEnabled = fromFlag (configTests cfg) } + flaggedTests = map (\(n, t) -> (n, mapTreeData enableTest t)) + (condTestSuites pkg_descr0) + pkg_descr0'' = pkg_descr0 { condTestSuites = flaggedTests } (pkg_descr0', flags) <- case finalizePackageDescription hunk ./Distribution/Simple/Configure.hs 481 (configScratchDir cfg), libraryConfig = configLib `fmap` library pkg_descr', executableConfigs = configExe `fmap` executables pkg_descr', - testSuiteConfigs = configTest `fmap` testSuites pkg_descr', + testSuiteConfigs = configTest `fmap` filter testEnabled (testSuites pkg_descr'), installedPkgs = packageDependsIndex, pkgDescrFile = Nothing, localPkgDescr = pkg_descr', hunk ./Distribution/Simple/Configure.hs 971 -> GenericPackageDescription -> PackageDescription -> IO () -checkPackageProblems verbosity gpkg pkg0 = do +checkPackageProblems verbosity gpkg pkg = do ioChecks <- checkPackageFiles pkg "." let pureChecks = checkPackage gpkg (Just pkg) errors = [ e | PackageBuildImpossible e <- pureChecks ++ ioChecks ] hunk ./Distribution/Simple/Configure.hs 980 then mapM_ (warn verbosity) warnings else do mapM_ (hPutStrLn stderr . ("Error: " ++)) errors exitWith (ExitFailure 1) - where - -- TODO: Sigh, this is a fairly unpleasent hack. The issue is that - -- we want to check test-suite sections even when tests are disabled. - -- When tests are disabled we have to exclude the test-suite sections - -- when resolving the conditionals. But the checks we do are done - -- on the post-resolved form! Ug. A better solution would be either - -- 1) to do the checks on the pre-resolved form - -- 2) to resolve in two steps: find a flag assignment, then apply it - -- that'd allow us to find the flag assingment ignoring tests - -- but then to apply it anyway. - -- In the meantime we stick the tests back in before checking by - -- flattening the pre-resovled form. - pkg = pkg0 { testSuites = testSuites (flattenPackageDescription gpkg) } hunk ./Distribution/Simple/Test.hs 61 ( PackageId ) import qualified Distribution.PackageDescription as PD ( PackageDescription(..), TestSuite(..) - , TestSuiteInterface(..), testType ) + , TestSuiteInterface(..), testType, hasTests ) import Distribution.Simple.Build.PathsModule ( pkgPathEnvVar ) import Distribution.Simple.BuildPaths ( exeExtension ) import Distribution.Simple.Compiler ( Compiler(..), CompilerId ) hunk ./Distribution/Simple/Test.hs 86 ( createDirectoryIfMissing, doesFileExist, getCurrentDirectory , removeFile ) import System.Environment ( getEnvironment ) -import System.Exit ( ExitCode(..), exitFailure, exitWith ) +import System.Exit ( ExitCode(..), exitFailure, exitSuccess, exitWith ) import System.FilePath ( (), (<.>) ) import System.IO ( hClose, IOMode(..), openFile ) import System.Process ( runProcess, waitForProcess ) hunk ./Distribution/Simple/Test.hs 245 testLogDir = distPref "test" testNames = fromFlag $ testList flags pkgTests = PD.testSuites pkg_descr + enabledTests = filter PD.testEnabled pkgTests doTest :: (PD.TestSuite, Maybe TestSuiteLog) -> IO TestSuiteLog doTest (suite, mLog) = do hunk ./Distribution/Simple/Test.hs 292 , logFile = "" } + when (not $ PD.hasTests pkg_descr) $ do + notice verbosity "Package has no test suites." + exitSuccess + + when (PD.hasTests pkg_descr && null enabledTests) $ + die $ "No test suites enabled. Did you remember to configure with " + ++ "\'--enable-tests\'?" + testsToRun <- case testNames of hunk ./Distribution/Simple/Test.hs 301 - [] -> return $ zip pkgTests $ repeat Nothing + [] -> return $ zip enabledTests $ repeat Nothing names -> flip mapM names $ \tName -> hunk ./Distribution/Simple/Test.hs 303 - let testMap = map (\x -> (PD.testName x, x)) pkgTests + let testMap = zip enabledNames enabledTests + enabledNames = map PD.testName enabledTests + allNames = map PD.testName pkgTests in case lookup tName testMap of Just t -> return (t, Nothing) hunk ./Distribution/Simple/Test.hs 308 - _ -> die $ "no such test: " ++ tName + _ | tName `elem` allNames -> + die $ "Package configured with test suite " + ++ tName ++ " disabled." + | otherwise -> die $ "no such test: " ++ tName createDirectoryIfMissing True testLogDir hunk ./tests/PackageTests/TestStanza/Check.hs 41 genPD <- readPackageDescription silent pdFile let compiler = CompilerId GHC $ Version [6, 12, 2] [] anyV = intersectVersionRanges anyVersion anyVersion - anticipatedFinalPD = emptyPackageDescription - { package = PackageIdentifier - { pkgName = PackageName "TestStanza" - , pkgVersion = Version [0, 1] [] - } - , license = BSD3 - , author = "Thomas Tuegel" - , stability = "stable" - , description = "Check that Cabal recognizes the Test stanza defined below." - , category = "PackageTests" - , specVersionRaw = Right anyVersion - , buildType = Just Simple - , buildDepends = - [ Dependency (PackageName "base") anyV ] - , library = Just emptyLibrary - { exposedModules = [fromString "MyLibrary"] - , libBuildInfo = emptyBuildInfo - { targetBuildDepends = - [ Dependency (PackageName "base") anyVersion ] - , hsSourceDirs = ["."] - } - } - , testSuites = [ emptyTestSuite - { testName = "dummy" - , testInterface = TestSuiteExeV10 (Version [1,0] []) "dummy.hs" - , testBuildInfo = emptyBuildInfo - { targetBuildDepends = - [ Dependency (PackageName "base") anyVersion ] - , hsSourceDirs = ["."] - } - } - ] - } + anticipatedTestSuite = emptyTestSuite + { testName = "dummy" + , testInterface = TestSuiteExeV10 (Version [1,0] []) "dummy.hs" + , testBuildInfo = emptyBuildInfo + { targetBuildDepends = + [ Dependency (PackageName "base") anyVersion ] + , hsSourceDirs = ["."] + } + , testEnabled = False + } case finalizePackageDescription [] (const True) buildPlatform compiler [] genPD of Left xs -> let depMessage = "should not have missing dependencies:\n" ++ (unlines $ map (show . disp) xs) hunk ./tests/PackageTests/TestStanza/Check.hs 55 in assertEqual depMessage True False - Right (f, _) -> assertEqual "parsed package description does not match anticipated" - f anticipatedFinalPD + Right (f, _) -> let gotTest = head $ testSuites f + in assertEqual "parsed test-suite stanza does not match anticipated" + gotTest anticipatedTestSuite } [Added other-modules for unit-tests to Cabal.cabal. Thomas Tuegel **20110111162719 Ignore-this: b49e49ca25d1b0661c978c90451587ca ] hunk ./Cabal.cabal 133 test-suite unit-tests type: exitcode-stdio-1.0 main-is: suite.hs + other-modules: PackageTests.BuildDeps.GlobalBuildDepsNotAdditive1.Check, + PackageTests.BuildDeps.GlobalBuildDepsNotAdditive2.Check, + PackageTests.BuildDeps.InternalLibrary0.Check, + PackageTests.BuildDeps.InternalLibrary1.Check, + PackageTests.BuildDeps.InternalLibrary2.Check, + PackageTests.BuildDeps.InternalLibrary3.Check, + PackageTests.BuildDeps.InternalLibrary4.Check, + PackageTests.BuildDeps.TargetSpecificDeps1.Check, + PackageTests.BuildDeps.TargetSpecificDeps2.Check, + PackageTests.BuildDeps.TargetSpecificDeps3.Check, + PackageTests.BuildDeps.SameDepsAllRound.Check, + PackageTests.TestStanza.Check, + PackageTests.PackageTester hs-source-dirs: tests build-depends: base, [Support for building libraries and test suites with HPC; automatic markup generation. Thomas Tuegel **20110111164304 Ignore-this: c3d7d441b1f9d968f871f624ad880f0 ] { hunk ./Cabal.cabal 85 Distribution.Simple.GHC, Distribution.Simple.LHC, Distribution.Simple.Haddock, + Distribution.Simple.Hpc, Distribution.Simple.Hugs, Distribution.Simple.Install, Distribution.Simple.InstallDirs, hunk ./Distribution/Simple/Configure.hs 90 ( finalizePackageDescription ) import Distribution.PackageDescription.Check ( PackageCheck(..), checkPackage, checkPackageFiles ) +import Distribution.Simple.Hpc ( enableCoverage ) import Distribution.Simple.Program ( Program(..), ProgramLocation(..), ConfiguredProgram(..) , ProgramConfiguration, defaultProgramConfiguration hunk ./Distribution/Simple/Configure.hs 344 -- add extra include/lib dirs as specified in cfg -- we do it here so that those get checked too - let pkg_descr = addExtraIncludeLibDirs pkg_descr0' + let pkg_descr = + enableCoverage (fromFlag (configLibCoverage cfg)) distPref + $ addExtraIncludeLibDirs pkg_descr0' when (not (null flags)) $ info verbosity $ "Flags chosen: " addfile ./Distribution/Simple/Hpc.hs hunk ./Distribution/Simple/Hpc.hs 1 +----------------------------------------------------------------------------- +-- | +-- Module : Distribution.Simple.Hpc +-- Copyright : Thomas Tuegel 2011 +-- +-- Maintainer : cabal-devel@haskell.org +-- Portability : portable +-- +-- This deals with the /configure/ phase. It provides the 'configure' action +-- which is given the package description and configure flags. It then tries +-- to: configure the compiler; resolves any conditionals in the package +-- description; resolve the package dependencies; check if all the extensions +-- used by this package are supported by the compiler; check that all the build +-- tools are available (including version checks if appropriate); checks for +-- any required @pkg-config@ packages (updating the 'BuildInfo' with the +-- results) +-- +-- Then based on all this it saves the info in the 'LocalBuildInfo' and writes +-- it out to the @dist\/setup-config@ file. It also displays various details to +-- the user, the amount of information displayed depending on the verbosity +-- level. + +{- All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of Isaac Jones nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -} + +module Distribution.Simple.Hpc + ( hpcDir + , enableCoverage + , tixDir + , tixFilePath + ) where + +import Distribution.Compiler ( CompilerFlavor(..) ) +import Distribution.PackageDescription + ( BuildInfo(..) + , Library(..) + , PackageDescription(..) + , TestSuite(..) + ) +import System.FilePath + +-- ------------------------------------------------------------------------- +-- Haskell Program Coverage + +enableCoverage :: Bool + -> String + -> PackageDescription + -> PackageDescription +enableCoverage False _ x = x +enableCoverage True distPref p = + p { library = fmap enableLibCoverage (library p) + , testSuites = map enableTestCoverage (testSuites p) + } + where + enableBICoverage name oldBI = + let oldOptions = options oldBI + oldGHCOpts = lookup GHC oldOptions + newGHCOpts = case oldGHCOpts of + Just xs -> (GHC, hpcOpts ++ xs) + _ -> (GHC, hpcOpts) + newOptions = (:) newGHCOpts $ filter ((== GHC) . fst) oldOptions + hpcOpts = ["-fhpc", "-hpcdir", hpcDir distPref name] + in oldBI { options = newOptions } + enableLibCoverage l = + l { libBuildInfo = enableBICoverage "library" (libBuildInfo l) } + enableTestCoverage t = + t { testBuildInfo = enableBICoverage (testName t) (testBuildInfo t) } + +hpcDir :: FilePath -> FilePath -> FilePath +hpcDir distPref name = distPref "hpc" name + +tixDir :: FilePath -> TestSuite -> FilePath +tixDir distPref suite = distPref "test" testName suite + +tixFilePath :: FilePath -> TestSuite -> FilePath +tixFilePath distPref suite = tixDir distPref suite testName suite <.> "tix" hunk ./Distribution/Simple/Setup.hs 291 configConstraints :: [Dependency], -- ^Additional constraints for -- dependencies configConfigurationsFlags :: FlagAssignment, - configTests :: Flag Bool -- ^Enable test suite compilation + configTests :: Flag Bool, -- ^Enable test suite compilation + configLibCoverage :: Flag Bool -- ^ Enable test suite program coverage } deriving (Read,Show) hunk ./Distribution/Simple/Setup.hs 313 configGHCiLib = Flag True, configSplitObjs = Flag False, -- takes longer, so turn off by default configStripExes = Flag True, - configTests = Flag False + configTests = Flag False, + configLibCoverage = Flag False } configureCommand :: ProgramConfiguration -> CommandUI ConfigFlags hunk ./Distribution/Simple/Setup.hs 467 "dependency checking and compilation for test suites listed in the package description file." configTests (\v flags -> flags { configTests = v }) (boolOpt [] []) + ,option "" ["library-coverage"] + "build library and test suites with Haskell Program Coverage enabled. (GHC only)" + configLibCoverage (\v flags -> flags { configLibCoverage = v }) + (boolOpt [] []) ] where readFlagList :: String -> FlagAssignment hunk ./Distribution/Simple/Setup.hs 578 configConstraints = mempty, configExtraIncludeDirs = mempty, configConfigurationsFlags = mempty, - configTests = mempty + configTests = mempty, + configLibCoverage = mempty } mappend a b = ConfigFlags { configPrograms = configPrograms b, hunk ./Distribution/Simple/Setup.hs 609 configConstraints = combine configConstraints, configExtraIncludeDirs = combine configExtraIncludeDirs, configConfigurationsFlags = combine configConfigurationsFlags, - configTests = combine configTests + configTests = combine configTests, + configLibCoverage = combine configLibCoverage } where combine field = field a `mappend` field b hunk ./Distribution/Simple/Test.hs 56 ) where import Distribution.Compat.TempFile ( openTempFile ) -import Distribution.ModuleName ( ModuleName ) +import Distribution.ModuleName ( ModuleName, main ) import Distribution.Package ( PackageId ) import qualified Distribution.PackageDescription as PD hunk ./Distribution/Simple/Test.hs 61 ( PackageDescription(..), TestSuite(..) - , TestSuiteInterface(..), testType, hasTests ) + , TestSuiteInterface(..), testType, hasTests, testModules ) import Distribution.Simple.Build.PathsModule ( pkgPathEnvVar ) import Distribution.Simple.BuildPaths ( exeExtension ) import Distribution.Simple.Compiler ( Compiler(..), CompilerId ) hunk ./Distribution/Simple/Test.hs 65 +import Distribution.Simple.Hpc ( hpcDir, tixDir, tixFilePath ) import Distribution.Simple.InstallDirs ( fromPathTemplate, initialPathTemplateEnv, PathTemplateVariable(..) , substPathTemplate , toPathTemplate, PathTemplate ) hunk ./Distribution/Simple/Test.hs 174 existingEnv <- getEnvironment let dataDirPath = pwd PD.dataDir pkg_descr shellEnv = Just $ (pkgPathEnvVar pkg_descr "datadir", dataDirPath) + : ("HPCTIXFILE", pwd tixFilePath distPref suite) : existingEnv bracket (openCabalTemp testLogDir) deleteIfExists $ \tempLog -> hunk ./Distribution/Simple/Test.hs 180 bracket (openCabalTemp testLogDir) deleteIfExists $ \tempInput -> do + -- Create directory for HPC files. + createDirectoryIfMissing True $ tixDir distPref suite + -- Write summary notices indicating start of test suite notice verbosity $ summarizeSuiteStart $ PD.testName suite appendFile tempLog $ summarizeSuiteStart $ PD.testName suite hunk ./Distribution/Simple/Test.hs 226 -- Write summary notice to terminal indicating end of test suite notice verbosity $ summarizeSuiteFinish suiteLog' + doHpcMarkup verbosity distPref suite + return suiteLog' hunk ./Distribution/Simple/Test.hs 229 - where - deleteIfExists file = do - exists <- doesFileExist file - when exists $ removeFile file hunk ./Distribution/Simple/Test.hs 230 - openCabalTemp testLogDir = do - (f, h) <- openTempFile testLogDir $ "cabal-test-" <.> "log" - hClose h >> return f +deleteIfExists :: FilePath -> IO () +deleteIfExists file = do + exists <- doesFileExist file + when exists $ removeFile file hunk ./Distribution/Simple/Test.hs 235 +openCabalTemp :: FilePath -> IO FilePath +openCabalTemp testLogDir = do + (f, h) <- openTempFile testLogDir $ "cabal-test-" <.> "log" + hClose h >> return f + +doHpcMarkup :: Verbosity -> FilePath -> PD.TestSuite -> IO () +doHpcMarkup verbosity distPref suite = do + hpcEnabled <- doesFileExist $ tixFilePath distPref suite + when hpcEnabled $ do + let hpcOptions = [ "markup" + , tixFilePath distPref suite + , "--hpcdir=" ++ hpcDir distPref "library" + , "--destdir=" ++ tixDir distPref suite + ] + ++ map (\x -> "--exclude=" ++ display x) + excludedModules + excludedModules = PD.testModules suite + ++ (case PD.testInterface suite of + PD.TestSuiteExeV10 _ _ -> [main] + _ -> []) + bracket (openCabalTemp $ tixDir distPref suite) deleteIfExists + $ \hpcOut -> do + hOut <- openFile hpcOut WriteMode + procHPC <- runProcess "hpc" hpcOptions + Nothing Nothing Nothing + (Just hOut) (Just hOut) + exit <- waitForProcess procHPC + case exit of + ExitSuccess -> notice verbosity $ "HPC: Markup written to " + ++ tixDir distPref suite "hpc_index" + <.> "html" + _ -> do + errs <- readFile hpcOut + die $ "HPC failed:\n" ++ errs + return () -- |Perform the \"@.\/setup test@\" action. test :: PD.PackageDescription -- ^information from the .cabal file } Context: [Removed documentation for obsolete options to 'setup test' from the User Guide. Thomas Tuegel **20110109180811 Ignore-this: ce7298400abd573023e5c3c1abbef10 ] [Document the '--{en,dis}able-tests' options in the User Guide Thomas Tuegel **20101204164404 Ignore-this: 28972ba6e70a3e91754dd42bfe9c2a5e ] [Update the changelog for 1.8.0.4, 1.8.0.6 and 1.10.0.0 Duncan Coutts **20101118203701 Ignore-this: 2b1693427bd29b84432b1b35a2f627c6 ] [Replace uses of the old try function with the new one Ian Lynagh **20101218230920 Ignore-this: e0a9db2f97bc3f90ceb5772944f4e25b ] [Replace uses of the old catch function with the new one Ian Lynagh **20101218213608] [Add GADTSyntax to extension list Ian Lynagh **20101218150259] [Allow CABAL_VERSION to be defined when bootstrapping Ian Lynagh **20101212213359 Needed for the GHC build system ] [Add NondecreasingIndentation to Language.Haskell.Extension Ian Lynagh **20101124223953 Ignore-this: 2d072a45d76770cf97553b0e5df9e998 ] [Export commandParseArgs Duncan Coutts **20101105140655 Ignore-this: f452f13b130e886ecd8262c6f24a0c52 ] [Add some more extensions that GHC knows about Ian Lynagh **20101026220409 Ignore-this: 92bbbb269985fe576798cd2cdba4ceca ] [Whitespace only Ian Lynagh **20101026220403 Ignore-this: 8746b070884de3ed45db486a0a49db3e ] [Fix parsing of empty default-language fields Ian Lynagh **20101026220312 Ignore-this: 99011d6c9af431e7c8d90c3cee364606 ] [Add support for general extension en/disabling Ian Lynagh **20101026145503] [Tweak a couple of types Ian Lynagh **20101026131250] [Generalise deprecatedExtensions Ian Lynagh **20101026131121 It now works with Extensions rather than KnownExtensions ] [Split known-extensions off into their own type, and remove knownExtensions Ian Lynagh **20101025232624 The knownExtensions list had already got out of sync with the datatype. Now we use an Enum instance to get the list of constructors. Also, having the actual extensions in a separate type than UnknownExtension and EnableExtension makes it easier to add extension disabling support later. ] [Add a test program to look for ghc extensions that are not registered Duncan Coutts **20101025163536 Ignore-this: cf38e2434eba386b83b818a29fd5ac14 Should live in the ghc testsuite but no harm having it here too. ] [Make the .cabal file fully 1.10-compliant Ian Lynagh **20101020133037 Ignore-this: 66409062c8d4b698f69aa58a83b85ef1 Add Default-Language field, and change Extensions to Default-Extensions. ] [Require "cabal-version: >= 1.10" as we use the new testsuite syntax Ian Lynagh **20101020131829 Ignore-this: 6aecdd77f78234f0359af0509f1ba636 ] [Fix warnings: Remove duplicate imports Ian Lynagh **20101020125710 Ignore-this: dea9d889078c729459e1ab92a8e54c08 ] [Merge conflicts Ian Lynagh **20101020112200 Ignore-this: d96cab403511f914d9d8df1a29ca58ee ] [Add final newline Simon Marlow **20101013125337 Ignore-this: 99e055c7186219369902a63c63c3fd76 Something in the Windows build was complaining about the lack of a final newline. ] [Update the pretty printer to the current testsuite interface Duncan Coutts **20101020120506 Ignore-this: 480a349e93be8228f81f93632cabe2c7 ] [Improve error messages about programs not being found Duncan Coutts **20101019074436 Ignore-this: 9b4daf9a09179482049146669af59f76 Make it clear it is a program we are talking about, not a library. ] [Add a note about the remaining issue with runhugs scripts Duncan Coutts **20101018232248 Ignore-this: 3e83a3238d08cdb3ad9e353d43fbf7fa ] [Add package QA checks for the new language and extensions fields Duncan Coutts **20101018180343 Ignore-this: a063fd21e86e4e19b8152258c5a0711f ] [Check at configure time that languages are supported by the compiler Duncan Coutts **20101018180300 Ignore-this: e3988c2eff46129b1f2732cd9647c935 ] [Add compiler support for using the new languages and extensions fields Duncan Coutts **20101018180151 Ignore-this: ec1b61767d492dcd2dfa6a07ace3b982 ] [Add hugs support for the languages and extensions fields Duncan Coutts **20101018175647 Ignore-this: 9b39c392119aebbbad22a64dcf992f88 Incidentally, should fixe ticket #43. ] [Add parsing for the new language and extensions fields Duncan Coutts **20101018091918 Ignore-this: c59c8ef96c83f35e293c8f495b89fda6 ] [Add new language and extensions fields (internal data structures) Duncan Coutts **20101018090620 Ignore-this: f49dd9278b0053bc441a37beeb2f6145 New fields default-language and other-languages for specifying the base languages for the package, e.g. Haskell98, Haskell2010 New fields default-extensions and other-extensions for the language extensions. Separate from the old extensions field. The separation lets us express the difference between declaring to the outside world that a package uses certain languages or extensions and whether certain languages or extensions should be applied to all modules in the package component. ] [Extend the Compiler interface to list the supported languages Duncan Coutts **20101018082608 Ignore-this: 8b1ab7cc14f35dd6604c2a85173ad48 ] [Add a Language type, starting with Haskell98 and Haskell2010 Duncan Coutts **20101018082208 Ignore-this: de80df5317b5d44900e30c947a86364b ] [Merge and tweaks following pretty printer changes Duncan Coutts **20101018195344 Ignore-this: 513a2b0ce02fed98f5beba0dd893eb16 ] [pretty printer fixes (FreeText starting with ., version tags, version range parens, option order). jnf@arcor.de**20101011094517 Ignore-this: 400ac5be014f1529632bd16ffd878a92 ] [reentered accidentally lost exports jnf@arcor.de**20100929105852 Ignore-this: 2ad4ecfac6feba4c2a59a131c05c8a40 ] [new cabal pretty printer. jnf@arcor.de**20100929103653 Ignore-this: 43f954ec31373e327f2c29fcbf3f0865 ] [Fix old doc links Duncan Coutts **20100727012425 Ignore-this: 9e9d0f2045adebe7bb38b5d1a7d2d71a ] [Add note about ticket #689 about deprecated extensions Duncan Coutts **20100622151328 Ignore-this: 56cf0027a4c10f4c07045e2ccdbb819c ] [Head version needs cabal-version: >=1.8 due to test stanza Duncan Coutts **20101017155521 Ignore-this: 6652a529071ccb2eb1cdeda3451aac30 ] [Remove unused cpp version definition Duncan Coutts **20101017155218 Ignore-this: 8dc3425bd811d60d28c2eaf365ec1e66 ] [Change the way we handle the version number during bootstrapping Duncan Coutts **20101016191252 Ignore-this: e21559acc28b7bd811dc4fe147e645b2 Means we only need to have the version in one place now. Yay. ] [Restore compatability with ghc-6.8 and 6.6 but drop support for ghc-6.4 Duncan Coutts **20101016182714 Ignore-this: 6aef933e4bfb4a9c47021d17370805ea ] [Add the Cabal unit tests as a test-suite stanza Duncan Coutts **20101016165656 Ignore-this: b9abbfe867754b8bf5b02919c1f25509 Still some other tests that need hooking up to this mechanism ] [Update the unit tests of the testsuite feature Duncan Coutts **20101016165615 Ignore-this: bc08d2a8609943f40e901c42916072c2 ] [Rename test --human-log to just --log Duncan Coutts **20101016153441 Ignore-this: a2ccb95759a67ae2888a2db2d2ba678d Still have --machine-log as a separate flag ] [Remove the test --append-human-log and --replay features Duncan Coutts **20101016153235 Ignore-this: 23d9c6431f929cd4078c54e03928cef2 ] [Add instance Text TestShowDetails parsing and use it for --show-details flag Duncan Coutts **20101016153015 Ignore-this: 1018e874b8acbf51bd7081df1210285 Rather than Read/Show ] [Fix a cabal-version check so it accepts the field missing entirely Duncan Coutts **20101016151929 Ignore-this: e30f6fe6e7f54cc5c791a3b6761e93de ] [Add testsuites to the allBuildInfo function, used mainly in checks Duncan Coutts **20101013172229 Ignore-this: be876b609bf1266f3928f25e94f87703 ] [Update the message for a package check Duncan Coutts **20101013172206 Ignore-this: 875cc7c6a763321f2e3251195c9dfb1e ] [Add a few TODOs about package checks Duncan Coutts **20101013172128 Ignore-this: 837bda043d740f0b92549f3379d43909 ] [Check test-suite sections even when they have been disabled at configure time Duncan Coutts **20101013171851 Ignore-this: 938113ec297b2e5c511a72c5ac8a86d ] [Default to Haskell98 for GHC 7.x Duncan Coutts **20101013022258 Ignore-this: c34b946f55e5ec054cc842914f58b5a5 GHC 7 defaults to Haskell2010, we stick with 98 for the moment. We will later introduce a new language field to control this. ] [Change the syntax and behaviour of the cabal-version field Duncan Coutts **20101013014933 Ignore-this: c4cb33360d623ff312b5c3f2d78f730c For historical reasons the cabal-version is specified with a version range, to indicate the range of versions of tools that the package will work with. We now think it makes more sense to specify the version of the Cabal spec that the package follows. Old Cabal versions will not be able to parse simple versions in this field. So we initially make the parser allow plain versions but then we add a check to warn about using it prior to Cabal-1.12 at which point it will be allowed. Added a check about using version ranges that are not of the form '>= x.y'. Also change behaviour to ignore upper bounds in the given version range. ] [Fix duplicate import warnings Ian Lynagh **20101012131227 Ignore-this: a9b51a864f95206f4d972f1e7506be55 ] [Remove the ghc Makefile stuff for the old docbook xml Duncan Coutts **20101010210026 Ignore-this: 6c714ba98b60e15e44577b64d2de3e1c Not woth keeping it, none of it can sensibly be reused. The GHC devs will need to add something new for the markdown user guide. ] [Update Makefile for new markdown user guide Duncan Coutts **20101010205938 Ignore-this: dcb5bd072c619516e23329f170458d72 ] [Add a FIXME about parsing cabal files Duncan Coutts **20101010203421 Ignore-this: 12804d54e81b5ea5878e52628717bc1d ] [Refactor the missing VCS info QA check Duncan Coutts **20101010192346 Ignore-this: fa6a50a9bd43cf9069e7cd16e23a2b4e Starting with Marc Weber's code and just moving it about and making it fit in a bit nicer. ] [Remove redundant import Duncan Coutts **20101010190724 Ignore-this: a978a6a257a31a57d07d57471f04af49 ] [Rename LocalBuildInfo extraArgs to extraConfigArgs to avoid name clashes Duncan Coutts **20101010190036 Ignore-this: 817061002399a51cbf31da2ba002737b ] [Add a bunch of TODOs about the test feature Duncan Coutts **20101010173245 Ignore-this: f2acc005fef4996a2c5260356eaf219f ] [Change how the test suite interfaces are represented, parsed and used Duncan Coutts **20101010162526 Ignore-this: 8773e7756fc23bc04c9e5b2b14031512 Also, stick to version 0.9 of the "detailed" test interface, since it's not quite finalised yet. Misc other minor code cleanups. ] [Added test suites to Cabal User Guide Thomas Tuegel **20100811141332 Ignore-this: 3975acc803fdba809ca1c8abeef21677 Ticket #215 (Overhaul support for packages' tests). ] [Removed "$stdio" from acceptable template variables Thomas Tuegel **20100810201828 Ignore-this: c50e05e9a73c726567eff0a364f29750 Ticket #215 (Overhaul support for packages' tests). In the usage message, the template variable "$stdio" was incorrectly listed as being available in the "--human-log" and "--machine-log" flags. The variable has been removed. ] [Added --test-option(s) flags Thomas Tuegel **20100809161341 Ignore-this: cea82267bbc0b16d5f21bfc086285905 Ticket #215 (Overhaul support for packages' tests). This patch adds the --test-option(s) flags for passing command-line options to test executables. ] [Respect verbosity flag when outputting test log Thomas Tuegel **20100809151517 Ignore-this: 73668e49eeea216c27b5233c7e3fe2cb Ticket #215 (Overhaul support for packages' tests). This patch corrects the printing of the human-readable test log to the terminal so the setting of the verbosity flag is respected. ] [Added --replay option to cabal test Thomas Tuegel **20100803164932 Ignore-this: c97d70e21d3847aa4d889304a7e94451 Ticket #215 (Overhaul support for packages' tests). This patch adds support for using machine logs from previous runs to replay tests with the same options. When using --replay, Cabal will replay all test suites listed in the machine log specified; test suite names specified on the command line are ignored. ] [Renamed "library" test suite type to "detailed" Thomas Tuegel **20100803141125 Ignore-this: 457c1a155020303962ae55b2bcd8415c Ticket #215 (Overhaul support for packages' tests). ] [Fixed human test log output for failing tests Thomas Tuegel **20100803030246 Ignore-this: f9d3ef127cdb849762af79f31a0c80c9 Ticket #215 (Overhaul support for packages' tests). This patch corrects the bug in the human test log output to terminal where the line wrapping code in Cabal caused terminal control codes output by the test framework to be placed incorrectly. Line wrapping is no longer performed. ] [Displaying human-readable test log when requested Thomas Tuegel **20100730151818 Ignore-this: 98f0adb8e47a52a59ccb3581982157ed Ticket #215 (Overhaul support for packages' tests). This patch causes Cabal to display the contents of the human-readable log file on the terminal when run with --show-details=always or when run with --show-details=failures and a failure is detected. The structure of the test logging code has been changed for clarity to debug a problem where test executables that write to their stderr channel disrupt terminal output. ] [Added debugging output to test summary Thomas Tuegel **20100730134008 Ignore-this: 826d20639f17ae0650d1c9b8a56b43a7 Ticket #215 (Overhaul support for packages' tests). ] [Using correct name of log file in human-readable log Thomas Tuegel **20100730041720 Ignore-this: 3c6df44f5d6414ce1fe2b58c50590726 Ticket #215 (Overhaul support for packages' tests). Previously, human-readable logs listed the name of the temporary file where test suite output is initially logged. ] [Renamed option '--test-filter' to '--show-details' Thomas Tuegel **20100730023026 Ignore-this: 8b78eed5ccf9cb7ed6a55b86d886e5cc Ticket #215 (Overhaul support for packages' tests). ] [Displaying location of test suite log on terminal Thomas Tuegel **20100729141159 Ignore-this: e98a67180c6ff1511b86e442f9acf3c1 Ticket #215 (Overhaul support for packages' tests). It was decided that indicating the location of the human-readable test suite log made Cabal's test runner easier to use. ] [Passing names of test suites to run to test stage Thomas Tuegel **20100726150811 Ignore-this: bf556a0a06fe26b132f1eb5caec21805 Ticket #215 (Overhaul support for packages' tests). ] [Fixed deprecation warning in Distribution.TestSuite Thomas Tuegel **20100726141448 Ignore-this: 64cd6a5a936efd6b0ee0f50564440a9d Ticket #215 (Overhaul support for packages' tests). Warning resulted from use of Control.OldException. ] [Fixed help message for machine-log path template Thomas Tuegel **20100724164652 Ignore-this: 52205830166a307eedce807e908f7a0a Ticket #215 (Overhaul support for packages' tests). The message previously indicated that $test-suite is acceptable in the machine log path template, which is not true. ] [Catching exceptions when lifting pure tests to IO Thomas Tuegel **20100724134336 Ignore-this: 89a2265a94ee0082935d236dd64c12d4 Ticket #215 (Overhaul support for packages' tests). ] [Using common function to name path environment variables in PathsModule and Test Thomas Tuegel **20100722145840 Ignore-this: 5cea1a3e77acb84a162de3d1c85a3fe6 Ticket #215 (Overhaul support for packages' tests). The names of environment variables used to set package paths at runtime were previously hard-coded into the function that generates the paths module. A function generating the variable names is now exported from Distribution.Simple.Build.PathsModule and used to set the datadir in Distribution.Simple.Test to prevent breakage if the naming scheme changes. ] [Added documentation for machine-readable test log types Thomas Tuegel **20100722140017 Ignore-this: 60f934e11b1c3ee4df9f48677528af47 Ticket #215 (Overhaul support for packages' tests). ] [Improved documentation for Distribution.TestSuite Thomas Tuegel **20100722124239 Ignore-this: f7b1261270c4815b0691ce33c664908c Ticket #215 (Overhaul support for packages' tests). ] [Fixed documentation errors in Distribution.Simple.Test Thomas Tuegel **20100721221844 Ignore-this: b111e727b4a556b17c2a1eb4dfd6971b Ticket #215 (Overhaul support for packages' tests). ] [Renamed Distribution.TestSuite.optionLookup to lookupOption Thomas Tuegel **20100721170724 Ignore-this: 3a5e79fd0a14d974e664a74af5cb83d1 Ticket #215 (Overhaul support for packages' tests.) ] [Added console-style test summary information to human-readable logs Thomas Tuegel **20100721163516 Ignore-this: 494c2220285ef4bda036ecdfd7242adf Ticket #215 (Overhaul support for packages' tests). ] [Added flag allowing human-readable test logs to be appended instead of overwritten Thomas Tuegel **20100721160421 Ignore-this: f157a4830f82a4a978c1cfb1931a0258 Ticket #215 (Overhaul support for packages' tests). ] [Added clarifying comments to Distribution.Simple.Test Thomas Tuegel **20100721160417 Ignore-this: 100000890351a75557a6dfa0f71c419f Ticket #215 (Overhaul support for packages' tests). ] [Using a separate PathTemplateEnv for machine test logs Thomas Tuegel **20100720204724 Ignore-this: 4920c6e88b8d3d3d788ba42d6b5268af Ticket #215 (Overhaul support for packages' tests). Previously, the use of a dummy test suite name would lead to unintuitive expansions of the PathTemplate governing the location of the machine-readable package test log. ] [Exporting machine log types from Distribution.Simple.Test Thomas Tuegel **20100720204558 Ignore-this: 6920621dbabf471cef7d688904b9b1b8 Ticket #215 (Overhaul support for packages' tests). These types were exported to enable parsing of test logs by external utilities. ] [Added 'check' and 'optionLookup' to Distribution.TestSuite Thomas Tuegel **20100720134707 Ignore-this: 21ef44dc0087ff8333b1722309f8fbdd Ticket #215 (Overhaul support for packages' tests). These functions were added for the benefit of test runner authors. ] [Saving Options from test runs for reproducability Thomas Tuegel **20100715180003 Ignore-this: 858c387d83e93e193f7c66df3901f6e3 Ticket #215 (Overhaul support for packages' tests). Saving the Options used required changes to the TestSuite interface, with the Option values now being specified as Strings and not Dynamics. This was necessary because the lack of a Read instance for Dynamic. ] [Improvements to test suite logging Thomas Tuegel **20100715020549 Ignore-this: b47f4358302b283e93ccaff81db123f2 Ticket #215 (Overhaul support for packages' tests). This patch includes proper support for both machine- and human-readable logs. ] [Removed duplicate code for test suite interface version checks Thomas Tuegel **20100713144835 Ignore-this: e06c264351013480a66c013ca398db4b Ticket #215 (Overhaul support for packages' tests). Duplicate code for checking the test suite interface version was replaced with a single function 'testVersion1 :: Version -> Bool' exported from Distribution.PackageDescription. ] [Added QA checks for test suite name conflicts Thomas Tuegel **20100712154401 Ignore-this: df13e2f16cf4e879f5d5f6538c6e7db8 Ticket #215 (Overhaul suppport for packages' tests). ] [New test suite log format Thomas Tuegel **20100708132650 Ignore-this: 96a300e6acedd0de63757713fbb1d832 Ticket #215 (Overhaul support for package's tests). This patch adds a new test log file format based on the TestSuiteLog data structure. The interface between Cabal and the library test suite runner has consequently changed. ] [Inheriting existing environment for test suite executables Thomas Tuegel **20100707222244 Ignore-this: 6f08245c83817a85c7da5a05f810abd6 Ticket #215 (Overhaul support for packages' tests). Previously, the test runner replaced the environment for test suite executables with one containing only the datadir path for package data files. For test suites invoking other programs, it is necessary to preserve the system paths, so the datadir path variable is appended to the inherited environment. ] [Improvements to library test suite runner, including documentation Thomas Tuegel **20100624181304 Ignore-this: 45baa7905de5423e91707f52e590bbad Ticket #215 (Overhaul support for packages' tests). ] [Renamed 'result' and 'getResult' to 'run' and 'runM' Thomas Tuegel **20100623184640 Ignore-this: 7bb6dd598eaa135fcbf73e82ab0d2ce2 Ticket #215 (Overhaul support for packages' tests). ] [Setting datadir environment variables when running tests Thomas Tuegel **20100623183201 Ignore-this: 7a9e26c684417871609847f6e4d4883e Ticket #215 (Overhaul support for packages' tests). ] [Added convenience functions and default instances making export of 'Test' constructors unnecessary Thomas Tuegel **20100623151934 Ignore-this: 1979265e345e268787b5b6fe49bdfd64 Ticket #215 (Overhaul support for packages' tests). ] [Added support for running the default stub executables Cabal creates for library test suites Thomas Tuegel **20100623151903 Ignore-this: 2be1bbfb07a7fc0e3a0d2c9e5bdf2252 Ticket #215 (Overhaul support for packages' tests). ] [Removed dependency on extensible-exceptions from detailed test suite interface Thomas Tuegel **20100623150227 Ignore-this: 50ad3ee8c2dc5f62b48aa84d0318c3e6 Ticket #215 (Overhaul support for packages' tests). ] [Added support for building detailed library test suites Thomas Tuegel **20100623150222 Ignore-this: 1f2a6034af9adf493088265cc8481df5 Ticket #215 (Overhaul support for packages' tests). This patch preprocesses and builds library test suites. The fake packages are created for each test suite, where the fake package and test suite share the same name; the packages and libraries are registered in the inplace package database so that test agents can build stub executables against them. ] [Improved security of test log file creation Thomas Tuegel **20100621114726 Ignore-this: 6fed3aa4ebcb587b48bb2a256fcbc61b Ticket #215 (Overhaul support for packages' tests). The algorithm previously used to name the log files for test output suffers from a known vulnerability due to the predictability of chosen names. ] [Added detailed test interface Thomas Tuegel **20100617210631 Ignore-this: 161624662d6ec7946a33415ddbff4445 Ticket #215 (Overhaul support for packages' tests). This patch provides the detailed test interface for exposing individual tests to Cabal and other test agents. It also provides the simple function Cabal will provide as the default test runner. ] [Fixed test suite breakage due to TestSuite API changes Thomas Tuegel **20100629212935 Ignore-this: 8de228836efb206e1adb833c841ae757 Ticket #215 (Overhaul support for packages' tests). The update to the TestSuite parser which stopped disallowed configurations during parsing also broke the existing test suite with API changes. ] [Added --test-filter flag Thomas Tuegel **20100624175917 Ignore-this: e8fcaddf34a42326d0f3a1081aafb724 Ticket #215 (Overhaul support for packages' tests). ] [Qualified import of Distribution.Simple.Setup in Distribution.Simple.Haddock Thomas Tuegel **20100623193755 Ignore-this: ec5750f56b22f67e5862036fcdd8ecee ] [Using path templates to name test log files Thomas Tuegel **20100622162317 Ignore-this: af6564bf6154e29e363ee343c9fc5806 Ticket #215 (Overhaul support for packages' tests). ] [More docs about the meaning of the cabal-version field Duncan Coutts **20101010154251 Ignore-this: 381ede9227f7a9db78f1007364660648 ] [Document how Cabal-Version affects behaviour of build-depends Ben Millwood **20100926025550 Ignore-this: ba6367db93c15906331457a0468db436 ] [initial support for building executables with UHC Atze Dijkstra **20100923214130 Ignore-this: bbbf1adcec2fcfe87ce1db18c804f21a ] [Added flags related to UHC, uhcbase package Atze Dijkstra **20100706115341 Ignore-this: f7dd2b14e3146f8844635ddcb70ac3b9 ] [Minor changes to the auto-reconfiguration feature. Duncan Coutts **20101010144111 Ignore-this: 944f595482ea42eb1907fb1150d6d4c0 Change the messages slightly. Make configure return the new lbi, rather than having to re-read the lbi from file (avoiding potential infinite loop if the IO failed). ] [Auto-reconfiguration when .cabal is newer than setup-config Dmitry Astapov **20100825131106 Ignore-this: 22ab2b6de0251f6cf1da7c2538544d4 This patch adds "ConfigFlags" to the "LocalBuildInfo" and reuses them to perform "configureAction" when .cabal file is changed. This has the same effect as re-running "configure" with the most recent used set of options, which should be the sensible thing to do. Closes #294, #477, #309 and #518. ] [Fix processing of ghc-shared-options Duncan Coutts **20101009204809 Ignore-this: 571b3d70fbc705282b9fdfdafdc2f009 Original patch was: Sun Oct 7 13:41:53 BST 2007 Thorkil Naur * Fix processing of shared options Re-recorded due to code churn ] [Correct spelling of 'transative' Duncan Coutts **20101009202836 Ignore-this: fe7ec5ae621135024403ae0aa42094c2 Original patch by: Thu Aug 21 21:19:51 MDT 2008 dbueno@gmail.com * Correct spelling of 'transative'. Re-recorded due to conflict. ] [print a warning if repository location isn't specified and the cabal project looks like being tracked by a version control system marco-oweber@gmx.de**20091129192013 Ignore-this: 5ce5073f1793193e437353490eff0276 ] [Bump Cabal HEAD version to 1.11.0 Duncan Coutts **20101010154518 Ignore-this: 407e2b1c0de8c10f399841b3fbea1dd3 ] [TAG 1.10 branch forked Duncan Coutts **20101010155050 Ignore-this: 7b0241166f919e2a374a2a69669b2e6b ] Patch bundle hash: 367ddd704cc386fd8db794fe6e6552c8a31f208d