packages feed

tasty-coverage 0.1.3.0 → 0.1.4.0

raw patch · 3 files changed

+19/−8 lines, 3 filesdep ~basedep ~containersdep ~filepathPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base, containers, filepath

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,5 +1,11 @@ # Revision history for tasty-test +## 0.1.4.0 -- 2024-09-10++* Bump dependencies to be compatible with GHC 9.10+* Warn if the examined tix files are empty. This is usually an indication that the user forgot to enable the -fhpc flag. [#17](https://github.com/BinderDavid/tasty-coverage/pull/17)++ ## 0.1.3.0 -- 2023-09-15  * If multiple tests with exactly the same name occur in the testsuite, then we generate new filenames by appending tick-marks to the later tests until the name is unique.
src/Test/Tasty/CoverageReporter.hs view
@@ -18,6 +18,7 @@ import qualified Data.Set as S import Data.Typeable import System.FilePath ((<.>), (</>))+import System.IO (hPutStrLn, stderr) import Test.Tasty import Test.Tasty.Ingredients import Test.Tasty.Options@@ -80,6 +81,10 @@ groupFold _ groupName acc = fmap (first (NE.cons groupName)) acc #endif +isEmptyTix :: Tix -> Bool+isEmptyTix (Tix []) = True+isEmptyTix _ = False+ -- | Collect all tests and coverageFold :: TreeFold FoldResult coverageFold =@@ -90,6 +95,8 @@               clearTix               result <- run opts test (\_ -> pure ())               tix <- examineTix+              when (isEmptyTix tix) $ do+                hPutStrLn stderr "Warning: Tix file is empty. Make sure to run the testsuite with -fhpc enabled."               let filepath = tixFilePath opts n result               writeTix filepath (removeHash opts tix)               putStrLn ("Wrote coverage file: " <> filepath)
tasty-coverage.cabal view
@@ -1,12 +1,12 @@ cabal-version:   3.0 name:            tasty-coverage-version:         0.1.3.0+version:         0.1.4.0 license:         BSD-3-Clause license-file:    LICENSE copyright:       David Binder, 2023 maintainer:      david.binder@uni-tuebingen.de author:          David Binder-tested-with:     ghc ==9.2.7 || ==9.4.5 || ==9.6.2+tested-with:     ghc ==9.2.7 || ==9.4.5 || ==9.6.2 || ==9.8.2 || ==9.10.1 homepage:        https://github.com/BinderDavid/tasty-coverage bug-reports:     https://github.com/BinderDavid/tasty-coverage/issues synopsis:@@ -14,7 +14,7 @@  description:     An ingredient for the tasty testing framework which allows to generate per-test coverage reports.-    For every test "foo" a file "foo.PASSED.tix" or "foo.FAILED.tix" is generated, depending on whether the test passed or failed. +    For every test "foo" a file "foo.PASSED.tix" or "foo.FAILED.tix" is generated, depending on whether the test passed or failed.  category:        Testing build-type:      Simple@@ -29,7 +29,7 @@  common deps     build-depends:-        base >=4.16 && <4.20,+        base >=4.16 && <4.21,         tasty >= 1.4 && < 1.6  library@@ -39,8 +39,6 @@     default-language: Haskell2010     ghc-options:      -Wall     build-depends:-        filepath >=1.3.8 && <=1.5,+        filepath >=1.3.8 && <=1.6,         hpc >=0.6 && <0.8,-        containers >=0.6 && <0.7,--+        containers >=0.6 && <0.8,