tasty-discover 4.1.4 → 4.1.5
raw patch · 4 files changed
+62/−15 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +7/−0
- README.md +28/−3
- library/Test/Tasty/Discover.hs +25/−10
- tasty-discover.cabal +2/−2
CHANGELOG.md view
@@ -8,6 +8,13 @@ [Keep a Changelog]: http://keepachangelog.com/ [Semantic Versioning]: http://semver.org/ +# 4.1.5 [2018-02-26]++## Fixed+- Fixed multi-byte string issue (see pull request [#138]).++[#138]: https://github.com/lwm/tasty-discover/pull/138+ # 4.1.4 [2018-02-25] ## Added
README.md view
@@ -6,8 +6,24 @@ # tasty-discover +- [Getting Started](#getting-started)+ * [Create Test Driver File](#create-test-driver-file)+ * [Configure Cabal or Hpack Test Suite](#configure-cabal-or-hpack-test-suite)+- [Write Tests](#write-tests)+- [Customise Discovery](#customise-discovery)+ * [No Arguments](#no-arguments)+ * [With Arguments](#with-arguments)+- [Example Project](#example-project)+- [Change Log](#change-log)+- [Deprecation Policy](#deprecation-policy)+- [Contributing](#contributing)+- [Maintenance](#maintenance)+- [Acknowledgements](#acknowledgements)+ Haskell auto-magic test discovery and runner for the [tasty framework]. +[tasty framework]: https://github.com/feuerbach/tasty+ Prefix your test case names and `tasty-discover` will discover, collect and run them. All popular Haksell test libraries are covered. Configure once and then just write your tests. Avoid forgetting to add test modules to your Cabal/Hpack@@ -16,8 +32,6 @@ See below for full documentation and examples. -[tasty framework]: https://github.com/feuerbach/tasty- # Getting Started There's 4 simple steps:@@ -164,7 +178,10 @@ Please see the [CHANGELOG.md] for the latest changes. +We try to keep [tagged releases] in our release process, if you care about that.+ [CHANGELOG.md]: https://github.com/lwm/tasty-discover/blob/master/CHANGELOG.md+[tagged releases]: https://github.com/lwm/tasty-discover/releases # Deprecation Policy @@ -177,17 +194,25 @@ # Contributing -All contributions welcome!+All contributions welcome! The continuous integration suite is pretty+comprehensive, so just get hacking and add a test case - there are *plenty* of+examples, so this should be simple - and I'll get to review your change ASAP. # Maintenance If you're interested in helping maintain this package, please let [@lwm] know! +You can [create an issue] or drop him a line at **lukewm AT riseup DOT NET**.+ [@lwm]: https://github.com/lwm+[create an issue]: https://github.com/lwm/tasty-discover/issues/new # Acknowledgements Thanks to [hspec-discover] and [tasty-auto] for making this possible. +A huge thanks to the growing list of [contributors].+ [hspec-discover]: https://hspec.github.io/hspec-discover.html [tasty-auto]: https://github.com/minad/tasty-auto+[contributors]: https://github.com/lwm/tasty-discover/graphs/contributors
library/Test/Tasty/Discover.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} -- | Automatic test discovery and runner for the tasty framework. module Test.Tasty.Discover (@@ -11,15 +12,24 @@ , showTests ) where -import Data.List (dropWhileEnd, intercalate, isPrefixOf,- nub, stripPrefix)-import qualified Data.Map.Strict as M-import Data.Maybe (fromMaybe)-import System.FilePath (pathSeparator, takeDirectory)-import System.FilePath.Glob (compile, globDir1, match)-import Test.Tasty.Config (Config (..), GlobPattern)-import Test.Tasty.Generator (Generator (..), Test (..), generators,- getGenerators, mkTest, showSetup)+import Data.List (dropWhileEnd, intercalate,+ isPrefixOf, nub, stripPrefix)+import qualified Data.Map.Strict as M+import Data.Maybe (fromMaybe)+#if defined(mingw32_HOST_OS)+import GHC.IO.Encoding.CodePage (mkLocaleEncoding)+import GHC.IO.Encoding.Failure (CodingFailureMode (TransliterateCodingFailure))+import GHC.IO.Handle (hGetContents, hSetEncoding)+#else+import GHC.IO.Handle (hGetContents)+#endif+import System.FilePath (pathSeparator, takeDirectory)+import System.FilePath.Glob (compile, globDir1, match)+import System.IO (IOMode (ReadMode), openFile)+import Test.Tasty.Config (Config (..), GlobPattern)+import Test.Tasty.Generator (Generator (..), Test (..),+ generators, getGenerators, mkTest,+ showSetup) -- | Main function generator, along with all the boilerplate which -- which will run the discovered tests.@@ -75,7 +85,12 @@ concat <$> traverse (extract directory) filtered where extract directory filePath = do- extractTests (dropDirectory directory filePath) <$> readFile filePath+ h <- openFile filePath ReadMode+#if defined(mingw32_HOST_OS)+ -- Avoid internal error: hGetContents: invalid argument (invalid byte sequence)' non UTF-8 Windows+ hSetEncoding h $ mkLocaleEncoding TransliterateCodingFailure+#endif+ extractTests (dropDirectory directory filePath) <$> hGetContents h dropDirectory directory filePath = fromMaybe filePath $ stripPrefix (directory ++ [pathSeparator]) filePath
tasty-discover.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 67adeac3d527af02d5415e0844c7369b646634800881dc80a115532354bdb1da+-- hash: ff97f14221b8cba7330502905bfa6e6ccd6cb64e5076c9772605583c06cbee29 name: tasty-discover-version: 4.1.4+version: 4.1.5 synopsis: Test discovery for the tasty framework. description: Automatic test discovery and runner for the tasty framework. Prefix your test case names and tasty-discover will discover, collect and run them. All popular test libraries are covered. Configure once and then just write your tests. Avoid forgetting to add test modules to your Cabal/Hpack files. Tasty ingredients are included along with various configuration options for different use cases. Please see the `README.md` below for how to get started.