tasty-hunit 0.4.1 → 0.8
raw patch · 3 files changed
+23/−15 lines, 3 filesdep ~tasty
Dependency ranges changed: tasty
Files
- CHANGELOG +1/−0
- Test/Tasty/HUnit.hs +14/−12
- tasty-hunit.cabal +8/−3
+ CHANGELOG view
@@ -0,0 +1,1 @@+See https://github.com/feuerbach/tasty/blob/master/CHANGES.md
Test/Tasty/HUnit.hs view
@@ -1,4 +1,4 @@--- | This module allows to use HUnit tests in tasty. +-- | This module allows to use HUnit tests in tasty. {-# LANGUAGE TypeFamilies, DeriveDataTypeable #-} module Test.Tasty.HUnit ( testCase@@ -31,6 +31,7 @@ import Data.Typeable import Control.Monad.Trans+import Control.Exception -- | Create a 'Test' for a HUnit 'Assertion' testCase :: TestName -> Assertion -> TestTree@@ -41,18 +42,19 @@ instance IsTest TestCase where run _ (TestCase assertion) _ = do- hunitResult <- performTestCase assertion+ -- The standard HUnit's performTestCase catches (almost) all exceptions.+ --+ -- This is bad for a few reasons:+ -- * it interferes with timeout handling+ -- * it makes exception reporting inconsistent across providers+ -- * it doesn't provide enough information for ingredients such as+ -- tasty-rerun+ --+ -- So we do it ourselves.+ hunitResult <- try assertion return $ case hunitResult of- Nothing ->- Result- { resultSuccessful = True- , resultDescription = ""- }- Just (_, message) ->- Result- { resultSuccessful = False- , resultDescription = message- }+ Right {} -> testPassed ""+ Left (HUnitFailure message) -> testFailed message testOptions = return []
tasty-hunit.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: tasty-hunit-version: 0.4.1+version: 0.8 synopsis: HUnit support for the Tasty test framework. description: HUnit support for the Tasty test framework. license: MIT@@ -12,13 +12,18 @@ -- copyright: category: Testing build-type: Simple--- extra-source-files: +extra-source-files: CHANGELOG cabal-version: >=1.10 +Source-repository head+ type: git+ location: git://github.com/feuerbach/tasty.git+ subdir: hunit+ library exposed-modules: Test.Tasty.HUnit -- other-modules: other-extensions: TypeFamilies, DeriveDataTypeable- build-depends: base ==4.*, tasty, HUnit, mtl+ build-depends: base ==4.*, tasty >= 0.8, HUnit, mtl -- hs-source-dirs: default-language: Haskell2010