hspec-test-framework (empty) → 0.0.0
raw patch · 7 files changed
+126/−0 lines, 7 filesdep +HUnitdep +QuickCheckdep +basesetup-changed
Dependencies added: HUnit, QuickCheck, base, hspec
Files
- LICENSE +19/−0
- Setup.lhs +3/−0
- hspec-test-framework.cabal +62/−0
- src/Test/Framework.hs +13/−0
- src/Test/Framework/Providers/API.hs +6/−0
- src/Test/Framework/Providers/HUnit.hs +14/−0
- src/Test/Framework/Providers/QuickCheck2.hs +9/−0
+ LICENSE view
@@ -0,0 +1,19 @@+Copyright (c) 2013 Simon Hengel <sol@typeful.net>++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in+all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN+THE SOFTWARE.
+ Setup.lhs view
@@ -0,0 +1,3 @@+#!/usr/bin/env runhaskell+> import Distribution.Simple+> main = defaultMain
+ hspec-test-framework.cabal view
@@ -0,0 +1,62 @@+name: hspec-test-framework+version: 0.0.0+license: MIT+license-file: LICENSE+copyright: (c) 2013 Simon Hengel+maintainer: Simon Hengel <sol@typeful.net>+build-type: Simple+cabal-version: >= 1.8+category: Testing+bug-reports: https://github.com/sol/hspec-test-framework/issues+homepage: http://hspec.github.io/+synopsis: Run test-framework tests with Hspec+description: A `test-framework` compatibility layer on top of Hspec, it+ allows you to run `test-framework` tests with Hspec+ unmodified.+ .+ All that is required is to remove+ .+ * `test-framework`+ .+ * `test-framework-quickcheck2`+ .+ * `test-framework-hunit`+ .+ * `test-framework-th`+ .+ from the `build-depends` section of your cabal file and add+ .+ * `hspec-test-framework`+ .+ * `hspec-test-framework-th`+ .+ in theire place.+ .+ NOTE: The packages `hspec-test-framework` and+ `hspec-test-framework-th` are hidden by default, so that they+ do not interfere with an installed version of+ `test-framework`. If you want to use them with e.g. `ghci`,+ you have to pass the command-line flags+ @-packagehspec-test-framework -packagehspec-test-framework-th@+ to GHC.++source-repository head+ type: git+ location: https://github.com/sol/hspec-test-framework++library+ exposed: False+ ghc-options:+ -Wall+ hs-source-dirs:+ src+ exposed-modules:+ Test.Framework+ Test.Framework.Providers.API+ Test.Framework.Providers.HUnit+ Test.Framework.Providers.QuickCheck2+ build-depends:+ base == 4.*+ , hspec >= 1.6.0+ , QuickCheck+ , HUnit
+ src/Test/Framework.hs view
@@ -0,0 +1,13 @@+module Test.Framework where++import Test.Hspec (parallel)+import Test.Hspec.Core (fromSpecList, describe)+import Test.Hspec.Runner (hspec)++import Test.Framework.Providers.API++defaultMain :: [Test] -> IO ()+defaultMain = hspec . parallel . fromSpecList++testGroup :: TestName -> [Test] -> Test+testGroup = describe
+ src/Test/Framework/Providers/API.hs view
@@ -0,0 +1,6 @@+module Test.Framework.Providers.API where++import Test.Hspec.Core (SpecTree)++type TestName = String+type Test = SpecTree
+ src/Test/Framework/Providers/HUnit.hs view
@@ -0,0 +1,14 @@+module Test.Framework.Providers.HUnit where++import Test.HUnit (Assertion)+import qualified Test.HUnit as HUnit+import Test.Hspec.Core+import Test.Hspec.HUnit++import Test.Framework.Providers.API++testCase :: TestName -> Assertion -> Test+testCase = it++hUnitTestToTests :: HUnit.Test -> [Test]+hUnitTestToTests = runSpecM . fromHUnitTest
+ src/Test/Framework/Providers/QuickCheck2.hs view
@@ -0,0 +1,9 @@+module Test.Framework.Providers.QuickCheck2 where++import Test.QuickCheck+import Test.Hspec.Core++import Test.Framework.Providers.API++testProperty :: Testable a => TestName -> a -> Test+testProperty name = it name . property