doctest-driver-gen 0.1.0.1 → 0.2.0.0
raw patch · 4 files changed
+39/−36 lines, 4 filesdep ~doctestPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: doctest
API changes (from Hackage documentation)
+ Test.DocTest.Gen: ddgen_run :: String -> String -> String -> [String] -> IO ()
- Test.DocTest.Gen: ddgen_output :: String -> String -> String -> [String] -> IO ()
+ Test.DocTest.Gen: ddgen_output :: String -> [String] -> IO ()
Files
- CHANGELOG.md +8/−7
- README.md +6/−4
- doctest-driver-gen.cabal +12/−6
- src/Test/DocTest/Gen.hs +13/−19
CHANGELOG.md view
@@ -1,15 +1,16 @@ # Changelog for doctest-driver-gen +## 0.2.0.0++* Add `ddgen_run`.+* Update `ddgen_output` to reduce arguments for simplicity.+* Update `build-depends` to allow `doctest-0.14`.+ ## 0.1.0.1 * Update `build-depends` to be strict. ## 0.1.0.0 (Initial) -doctest-driver-gen is a doctest driver file generator. It lets you automatically generate driver file for doctest's cabal integration.--### Usage-- {-# OPTIONS_GHC -F -pgmF doctest-driver-gen [-optF OPTION]... #-}--Make your driver file with the content. `OPTION` is doctest's option. You can see help with `doctest --help`.+* Add a executable program: doctest-driver-gen.+* Add `Test.DocTest.Gen`, `ddgen`, `ddgen_output`, and `ddgen_usage`.
README.md view
@@ -2,17 +2,19 @@ [](http://hackage.haskell.org/package/doctest-driver-gen) [](https://travis-ci.org/Hexirp/doctest-driver-gen)+[](https://www.stackage.org/lts/package/doctest-driver-gen)+[](https://www.stackage.org/nightly/package/doctest-driver-gen) -doctest-driver-gen is a doctest driver file generator. It lets you automatically generate driver file for doctest's cabal integration.+doctest-driver-gen is a doctest's driver file generator. It lets you automatically generate driver file for [doctest's cabal integration](https://github.com/sol/doctest/blob/master/README.markdown#cabal-integration). ## Usage ```haskell-{-# OPTIONS_GHC -F -pgmF doctest-driver-gen [-optF OPTION]... #-}+{-# OPTIONS_GHC -F -pgmF doctest-driver-gen [-optF DOCTEST_OPTION]... #-} ``` -Make your driver file with the content. `OPTION` is doctest's option. You can see help with `doctest --help`.+Make your driver file with the content. ## Motivation -This package was motivated by [doctest-discover](https://hackage.haskell.org/package/doctest-discover).+This package was motivated by [doctest-discover](https://hackage.haskell.org/package/doctest-discover). I want a simpler doctest's driver file generator.
doctest-driver-gen.cabal view
@@ -1,7 +1,7 @@ name: doctest-driver-gen-version: 0.1.0.1-synopsis: Generate doctest-driver.hs-description: doctest-driver-gen is a doctest driver file generator.+version: 0.2.0.0+synopsis: Generate driver file for doctest's cabal integration+description: doctest-driver-gen is a doctest's driver file generator. It lets you automatically generate driver file for doctest's cabal integration. homepage: https://github.com/Hexirp/doctest-driver-gen#readme@@ -9,7 +9,7 @@ license-file: LICENSE author: Hexirp maintainer: https://github.com/Hexirp/doctest-driver-gen/issues-copyright: 2017 Hexirp+copyright: 2017-2018 Hexirp category: Testing build-type: Simple extra-source-files: README.md, CHANGELOG.md@@ -19,8 +19,9 @@ hs-source-dirs: src exposed-modules: Test.DocTest.Gen build-depends: base >= 4.0 && < 4.11- -- doctest 0.12 is disabled. This dependency is not truly necessary, but it looks good.- , doctest >= 0.7 && < 0.12 || >= 0.13 && < 0.14+ -- This dependency is not really necessary, but it looks+ -- good.+ , doctest >= 0.7 && < 0.12 || >= 0.13 && < 0.15 ghc-options: -Wall default-language: Haskell2010 @@ -45,3 +46,8 @@ source-repository head type: git location: https://github.com/Hexirp/doctest-driver-gen++source-repository this+ type: git+ location: https://github.com/Hexirp/doctest-driver-gen+ tag: 0.1.0.1
src/Test/DocTest/Gen.hs view
@@ -1,38 +1,33 @@ -- | -- Module : Test.DocTest.Gen+-- Copyright : (c) 2017 Hexirp --+-- License : BSD 3-clause "New" or "Revised" License+-- Maintainer : https://github.com/Hexirp/doctest-driver-gen/issues -- Stability : experimental -- Portability : portable -- -- Provide doctest-driver-gen's functions. module Test.DocTest.Gen where import Prelude- import Data.List (unlines) - -- * Usage-- -- $usage- --- -- > {-# OPTIONS_GHC -F -pgmF doctest-driver-gen [-optF OPTION]... #-}- --- -- Make your driver file with the content.- -- @OPTION@ is doctest's option. You can see help with @doctest --help@.-- -- * Documentation- -- | Run doctest-driver-gen with given list of arguments. ddgen :: [String] -> IO ()- ddgen (src : inp : out : opts) = ddgen_output src inp out opts+ ddgen (src : inp : out : opts) = ddgen_run src inp out opts ddgen _ = ddgen_usage - -- | Output driver file.- ddgen_output+ -- | Run doctest-driver-gen with correct arguments.+ ddgen_run :: String -- ^ Name of the original source file. -> String -- ^ Name of the file holding the input. -> String -- ^ Name of the file where this should write its output to. -> [String] -- ^ Options for doctest. -> IO ()- ddgen_output _ _ out opts = writeFile out $ unlines [+ ddgen_run _ _ out opts = ddgen_output out opts++ -- | Output driver file.+ ddgen_output :: String -> [String] -> IO ()+ ddgen_output out opts = writeFile out $ unlines [ "import Test.DocTest", "", "main :: IO ()",@@ -42,7 +37,6 @@ ddgen_usage :: IO () ddgen_usage = putStrLn $ unlines [ "Usage:",- " {-# OPTIONS_GHC -F -pgmF doctest-driver-gen [-optF OPTION]... #-}",+ " {-# OPTIONS_GHC -F -pgmF doctest-driver-gen [-optF DOCTEST_OPTION]... #-}", "",- "Make your driver file with the content.",- "\"OPTION\" is doctest's option. You can see help with \"doctest --help\"."]+ "Make your driver file with the content."]