hpc 0.6.0.2 → 0.6.0.3
raw patch · 3 files changed
+47/−20 lines, 3 filesdep ~basedep ~containersdep ~directoryPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, containers, directory, time
API changes (from Hackage documentation)
Files
- Trace/Hpc/Mix.hs +37/−16
- changelog.md +6/−0
- hpc.cabal +4/−4
Trace/Hpc/Mix.hs view
@@ -22,10 +22,15 @@ ) where -import Data.Maybe (catMaybes)+import Data.List+import Data.Maybe (catMaybes, fromMaybe) import Data.Time (UTCTime) import Data.Tree-import Data.Char+#if MIN_VERSION_base(4,6,0)+import Text.Read (readMaybe)+#else+import Data.Char (isSpace)+#endif import System.FilePath @@ -36,6 +41,13 @@ import Trace.Hpc.Util (HpcPos, insideHpcPos, Hash, HpcHash(..), catchIO) import Trace.Hpc.Tix +#if !MIN_VERSION_base(4,6,0)+readMaybe :: Read a => String -> Maybe a+readMaybe s = case reads s of+ [(x, s')] | all isSpace s' -> Just x+ _ -> Nothing+#endif+ -- | 'Mix' is the information about a modules static properties, like -- location of Tix's in a file. --@@ -89,18 +101,15 @@ -> Either String TixModule -- ^ module wanted -> IO Mix readMix dirNames mod' = do- let modName = case mod' of- Left str -> str- Right tix -> tixModuleName tix- res <- sequence [ (do contents <- readFile (mixName dirName modName)- case reads contents of- [(r@(Mix _ _ h _ _),cs)]- | all isSpace cs- && (case mod' of- Left _ -> True- Right tix -> h == tixModuleHash tix- ) -> return $ Just r- _ -> return $ Nothing) `catchIO` (\ _ -> return $ Nothing)+ let modName = either id tixModuleName mod'+ res <- sequence [ (do let mixPath = mixName dirName modName+ parseError = error ("can not parse " ++ mixPath)+ parse = fromMaybe parseError . readMaybe+ mix <- parse `fmap` readFile mixPath+ case mod' of+ Left _ -> return $ Just mix -- Bypass hash check+ Right tix -> return $ checkHash tix mix mixPath)+ `catchIO` (\ _ -> return $ Nothing) | dirName <- dirNames ] case catMaybes res of@@ -108,12 +117,24 @@ -- Only complain if multiple *different* `Mix` files with the -- same name are found (#9619). error $ "found " ++ show(length xs) ++ " different instances of "- ++ modName ++ " in " ++ show dirNames+ ++ modName ++ " in " ++ intercalate ", " dirNames (x:_) -> return x- _ -> error $ "can not find " ++ modName ++ " in " ++ show dirNames+ _ -> error $ "can not find "+ ++ modName ++ " in " ++ intercalate ", " dirNames mixName :: FilePath -> String -> String mixName dirName name = dirName </> name <.> "mix"++-- | Check that hash in .tix and .mix file match.+checkHash :: TixModule -> Mix -> FilePath -> Maybe Mix+checkHash tix mix@(Mix _ _ mixHash _ _) mixPath+ | modHash == mixHash = Just mix+ | otherwise = error $+ "hash in tix file for module " ++ modName ++ " (" ++ show modHash ++ ")\n"+ ++ "does not match hash in " ++ mixPath ++ " (" ++ show mixHash ++ ")"+ where+ modName = tixModuleName tix+ modHash = tixModuleHash tix ------------------------------------------------------------------------------
changelog.md view
@@ -1,5 +1,11 @@ # Changelog for [`hpc` package](http://hackage.haskell.org/package/hpc) +## 0.6.0.3 *May 2016*++ * Bundled with GHC 8.0.1++ * Improved error messages (#10529)+ ## 0.6.0.2 *Mar 2015* * Bundled with GHC 7.10.1
hpc.cabal view
@@ -1,5 +1,5 @@ name: hpc-version: 0.6.0.2+version: 0.6.0.3 -- NOTE: Don't forget to update ./changelog.md license: BSD3 license-file: LICENSE@@ -10,7 +10,7 @@ synopsis: Code Coverage Library for Haskell build-type: Simple cabal-version:>=1.10-tested-with: GHC==7.6.3, GHC==7.6.2, GHC==7.6.1, GHC==7.4.2, GHC==7.4.1, GHC==7.2.2+tested-with: GHC==8.0.*, GHC==7.10.*, GHC==7.8.*, GHC==7.6.*, GHC==7.4.*, GHC==7.2.2 description: This package provides the code coverage library for Haskell. .@@ -35,9 +35,9 @@ Trace.Hpc.Reflect Build-Depends:- base >= 4.4.1 && < 4.9,+ base >= 4.4.1 && < 4.10, containers >= 0.4.1 && < 0.6, directory >= 1.1 && < 1.3, filepath >= 1 && < 1.5,- time >= 1.2 && < 1.6+ time >= 1.2 && < 1.7 ghc-options: -Wall