hoopl 3.10.1.0 → 3.10.2.0
raw patch · 9 files changed
+103/−4 lines, 9 filesdep +filepathdep +mtldep +parsecnew-uploaderPVP ok
version bump matches the API change (PVP)
Dependencies added: filepath, mtl, parsec, test-framework, test-framework-hunit
API changes (from Hackage documentation)
+ Compiler.Hoopl: type Showing n = forall e x. n e x -> String
Files
- README.md +10/−0
- changelog.md +14/−0
- hoopl.cabal +23/−2
- src/Compiler/Hoopl.hs +1/−1
- src/Compiler/Hoopl/Fuel.hs +5/−0
- src/Compiler/Hoopl/Graph.hs +4/−0
- src/Compiler/Hoopl/Show.hs +1/−1
- src/Compiler/Hoopl/Unique.hs +5/−0
- testing/Main.hs +40/−0
README.md view
@@ -20,6 +20,16 @@ cabal build cabal install --enable-documentation +To run the tests in the folder testing/, change to the src directory and run ++ cabal configure --enable-tests+ cabal test++To run the tests with the test coverage report, change to the src directory and run ++ cabal configure --enable-tests -f testcoverage+ cabal test+ You'll need a Haskell Platform, which should include appropriate versions of Cabal and GHC.
changelog.md view
@@ -1,5 +1,19 @@ # Changelog for [`hoopl` package](http://hackage.haskell.org/package/hoopl) +## 3.10.1.1 *Aug 2015*++ - Add #if CABAL macro to several hoopl source files such that the Cabal generated macro is not included when building in ghci++ - Change the test code (testing/*) to compare the converted graphs against the expected graphs in AST form ++ - Update the cabal file to run tests and generate a test coverage report + + - Unhide gSplice of Hoopl.Graph++ - Expose Showing of Hoopl.Show++ - Some fixes of testing+ ## 3.10.1.0 *Apr 2015* - Re-export runWithFuel from Compiler.Hoopl.
hoopl.cabal view
@@ -1,5 +1,5 @@ Name: hoopl-Version: 3.10.1.0+Version: 3.10.2.0 -- NOTE: Don't forget to update ./changelog.md Description: Higher-order optimization library@@ -12,7 +12,7 @@ Author: Norman Ramsey, Joao Dias, Simon Marlow and Simon Peyton Jones Maintainer: nr@cs.tufts.edu, andreas.voellmy@gmail.com, email@ningwang.org Homepage: http://ghc.cs.tufts.edu/hoopl/-Bug-Reports: http://ghc.haskell.org/trac/ghc/newticket?component=libraries/hoopl+Bug-Reports: https://github.com/haskell/hoopl/issues/ Build-Type: Simple Cabal-Version: >=1.10 Synopsis: A library to support dataflow analysis and optimization@@ -24,6 +24,11 @@ Type: git Location: http://git.haskell.org/packages/hoopl.git +flag testcoverage + description: Enable test coverage report+ default: False++ Library Default-Language: Haskell2010 Other-Extensions: CPP@@ -68,3 +73,19 @@ Ghc-Options: -Wall -fno-warn-name-shadowing +Test-Suite hoopl-test+ Default-Language: Haskell2010+ Type: exitcode-stdio-1.0+ Main-Is: Main.hs+ Hs-Source-Dirs: testing src+ Build-Depends: base >= 4.3 && < 4.9, + containers >= 0.4 && < 0.6,+ filepath,+ mtl >= 2.1.3.1,+ parsec >= 3.1.7,+ test-framework < 0.9,+ test-framework-hunit < 0.4,+ mtl >= 2.1.3.1++ if flag(testcoverage) + Ghc-Options: -fhpc
src/Compiler/Hoopl.hs view
@@ -29,7 +29,7 @@ import Compiler.Hoopl.Debug import Compiler.Hoopl.Fuel hiding (withFuel, getFuel, setFuel) import Compiler.Hoopl.Block-import Compiler.Hoopl.Graph hiding (splice, gSplice)+import Compiler.Hoopl.Graph hiding (splice) import Compiler.Hoopl.Label hiding (uniqueToLbl, lblToUnique) import Compiler.Hoopl.MkGraph import Compiler.Hoopl.Pointed
src/Compiler/Hoopl/Fuel.hs view
@@ -21,9 +21,14 @@ import Compiler.Hoopl.Checkpoint import Compiler.Hoopl.Unique +#if CABAL #if !MIN_VERSION_base(4,8,0) import Control.Applicative (Applicative(..)) #endif+#else+import Control.Applicative (Applicative(..))+#endif+ import Control.Monad (ap,liftM) class Monad m => FuelMonad m where
src/Compiler/Hoopl/Graph.hs view
@@ -46,7 +46,11 @@ import Compiler.Hoopl.Block import Compiler.Hoopl.Label +#if CABAL #if !MIN_VERSION_base(4,8,0)+import Control.Applicative (Applicative(..))+#endif+#else import Control.Applicative (Applicative(..)) #endif import Control.Monad (ap,liftM,liftM2)
src/Compiler/Hoopl/Show.hs view
@@ -4,7 +4,7 @@ #endif module Compiler.Hoopl.Show - ( showGraph, showFactBase+ ( showGraph, showFactBase, Showing ) where
src/Compiler/Hoopl/Unique.hs view
@@ -24,9 +24,14 @@ import qualified Data.IntMap as M import qualified Data.IntSet as S +#ifdef CABAL #if !MIN_VERSION_base(4,8,0) import Control.Applicative #endif+#else+import Control.Applicative+#endif+ import Control.Monad (ap,liftM) -----------------------------------------------------------------------------
+ testing/Main.hs view
@@ -0,0 +1,40 @@+module Main (main) where++import qualified System.FilePath as FilePath++import qualified Test.Framework as Framework+import qualified Test.Framework.Providers.HUnit as HUnit++import qualified Test++main :: IO ()+main = Framework.defaultMain tests++tests :: [Framework.Test]+tests = [goldensTests]++-- | All the tests that depend on reading an input file with a simple program,+-- parsing and optimizing it and then comparing with an expected output.+goldensTests :: Framework.Test+goldensTests = Framework.testGroup "Goldens tests"+ [ HUnit.testCase inputFile $ compareWithExpected inputFile expectedFile+ | (inputFile, expectedFile) <- zip inputFiles expectedFiles ]+ where+ compareWithExpected = Test.optTest+ inputFiles = [ basePath FilePath.</> test | test <- testFileNames ]+ expectedFiles = [ basePath FilePath.</> test FilePath.<.> "expected"+ | test <- testFileNames ]+ basePath = "testing" FilePath.</> "tests"+ testFileNames =+ [ "test1"+ , "test2"+ , "test3"+ , "test4"+ , "test5"+ , "test6"+ , "test7"+ , "if-test"+ , "if-test2"+ , "if-test3"+ , "if-test4"+ ]