packages feed

speculation 0.8.0.1 → 0.8.0.2

raw patch · 3 files changed

+62/−32 lines, 3 filessetup-changed

Files

CHANGELOG.markdown view
@@ -1,3 +1,7 @@+/0.8.0.2/:++ * changed tests and benchmarks to not build by default to work around corruption in the hackage db+ /0.8.0.1/:    * test suite now forces build
Setup.lhs view
@@ -2,9 +2,11 @@ \begin{code} {-# LANGUAGE CPP #-} -import Control.Monad (unless, mplus)+import Control.Monad (when, unless, mplus) -import Distribution.PackageDescription     (PackageDescription)+import Data.Maybe (listToMaybe, fromMaybe)+import Distribution.PackageDescription     +    (PackageDescription, buildable, exeName, buildInfo, executables, customFieldsBI, BuildInfo) import Distribution.Verbosity              (normal) import Distribution.Simple.Build           (build) import Distribution.Simple.LocalBuildInfo  (LocalBuildInfo(..))@@ -39,6 +41,13 @@     Just hpc <- findExecutable "hpc"     return hpc +testSpeculation :: a -> (BuildInfo -> a) -> PackageDescription -> a+testSpeculation dflt f pd = +    fromMaybe dflt $ listToMaybe +               [ f (buildInfo exe)+               | exe <- executables pd+               , exeName exe == "test-speculation" ]+ testHook :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO () testHook args0 _unknown pd lbi = do     let args = if null args0 then [] else "-t" : args0@@ -48,34 +57,50 @@     canonicalBuildDir <- canonicalizePath (buildDir lbi)     t <- doesDirectoryExist testDir     unless t $ do+        unless (testSpeculation False buildable pd) $ do+          fail "Reconfigure with 'cabal configure -ftests' or 'cabal install -ftests' and try again."         putStrLn "building tests"         build pd lbi defaultBuildFlags knownSuffixHandlers         putStrLn "tests built"+     setCurrentDirectory testDir-    do removeFile "test-speculation.tix" -       putStrLn $ "removed test-speculation.tix" -     `catch` \_ -> return ()+    let customFields = testSpeculation [] customFieldsBI pd+        profiling = maybe False (const True) $ lookup "x-hpc" customFields++    when profiling $ do +        removeFile "test-speculation.tix" +        putStrLn $ "removed test-speculation.tix" +       `catch` \_ -> return ()+     exitcode <- system $ unwords $ "test-speculation" : args     unless (exitcode == ExitSuccess) $          fail "test failed"-    hpc <- findHPC lbi -    exitcode <- system $ unwords $ hpc ++    when profiling $ do+      hpc <- findHPC lbi ++      exitcode <- system $ unwords $ hpc              : "report"              : "test-speculation"              : "--srcdir=../../.."              : []-    let markupDir base = base </> "doc" </> "html" </> "test-speculation"-    createDirectoryIfMissing True (markupDir canonicalBuildDir)-    exitcode <- system $ unwords $ hpc +      unless (exitcode == ExitSuccess) $ +        fail "hpc report failed"++      let markupDir base = base </> "doc" </> "html" </> "test-speculation"+      createDirectoryIfMissing True (markupDir canonicalBuildDir)++      exitcode <- system $ unwords $ hpc              : "markup"              : "test-speculation"             : "--srcdir=../../.."              : ("--destdir=" ++ markupDir canonicalBuildDir)              : "--exclude=Main"              : []-    unless (exitcode == ExitSuccess) $ +      unless (exitcode == ExitSuccess) $          fail "hpc report failed"-    putStrLn $ "Code coverage created: " ++ (markupDir (buildDir lbi) </> "hpc_index.html")++      putStrLn $ "Code coverage created: " ++ (markupDir (buildDir lbi) </> "hpc_index.html")  \end{code} 
speculation.cabal view
@@ -1,5 +1,5 @@ name:           speculation-version:        0.8.0.1+version:        0.8.0.2 license:        BSD3 license-file:   LICENSE author:         Edward A. Kmett@@ -55,43 +55,43 @@   location: http://github.com/ekmett/speculation.git   branch:   master -flag optimize-  description: Enable optimizations+flag lib+  description: Build the library. Useful for speeding up the modify-build-test cycle.   default:     True  flag tests   description: Build the tests-  default:     True+  default:     False  flag benchmarks   description: Build the benchmarks+  default:     False++flag optimize+  description: Enable optimizations for the library and benchmarks   default:     True  flag hpc   description: Use HPC for tests   default:     True -flag nolib-  description: Don't build the library. Useful for speeding up the modify-build-test cycle.-  default:     False  library-  ghc-options: -Wall--  if flag(optimize)-    ghc-options: -funbox-strict-fields -O2 -fspec-constr -fdicts-cheap--  if flag(nolib)+  if !flag(lib)     buildable: False+  else +    ghc-options: -Wall+    if flag(optimize)+      ghc-options: -funbox-strict-fields -O2 -fspec-constr -fdicts-cheap -  build-depends:-    base >= 4 && < 6,-    parallel >= 2.2 && < 2.3,-    stm >= 2.1 && < 2.2+    build-depends:+      base >= 4 && < 6,+      parallel >= 2.2 && < 2.3,+      stm >= 2.1 && < 2.2 -  exposed-modules:-    Control.Concurrent.Speculation-    Data.Foldable.Speculation+    exposed-modules:+      Control.Concurrent.Speculation+      Data.Foldable.Speculation  executable test-speculation   main-is: Test.hs@@ -100,6 +100,7 @@   else     if flag(hpc)       ghc-options: -fhpc+      x-hpc: true     ghc-options: -Wall     build-depends:       base >= 4 && < 6,