cabal-doctest 1.0.2 → 1.0.3
raw patch · 4 files changed
+48/−7 lines, 4 filesnew-uploaderPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- README.md +41/−6
- cabal-doctest.cabal +1/−1
- src/Distribution/Extra/Doctest.hs +2/−0
ChangeLog.md view
@@ -1,3 +1,7 @@+# 1.0.3 -- 2017-11-02++* Add an explicit `Prelude` import to `Build_doctests`+ # 1.0.2 -- 2017-05-16 * Add `defaultMainAutoconfWithDoctests` and `addDoctestsUserHook`.
README.md view
@@ -72,7 +72,7 @@ x-doctest-modules: Servant.Utils.LinksSpec ...- ```+``` * `x-doctest-options` Additional arguments passed into `doctest` command. * `x-doctest-modules` Additional modules to `doctest`. May be useful if you@@ -82,6 +82,20 @@ Notes ----- +* Recent versions of `Cabal` (for instance, 2.0) can choose to build a+ package's `doctest` test suite _before_ the library. However, in order for+ `cabal-doctest` to work correctly, the library _must_ be built first, as+ `doctest` relies on the presence of generated files that are only created+ when the library is built. See+ [#19](https://github.com/phadej/cabal-doctest/issues/19).++ A hacky workaround for this problem is to depend on the library itself in a+ `doctests` test suite. See+ [the example's .cabal file](https://github.com/phadej/cabal-doctest/blob/master/example/example.cabal)+ for a demonstration. (This assumes that the test suite has the ability to+ read build artifacts from the library, a separate build component. In+ practice, this assumption holds, which is why this library works at all.)+ * `custom-setup` section is supported starting from `cabal-install-1.24`. For older `cabal-install's` you have to install custom setup dependencies manually.@@ -94,11 +108,6 @@ about adding `cabal doctest` command. After that command is implemented, this library will be deprecated. -* If your library contains `cbits`, you might need to depend on the library- itself in `doctests` test-suite. We aren't sure whether this a bug or not.- See [#5 issue](https://github.com/phadej/cabal-doctest/issues/5) for longer- explanation.- * You can use `x-doctest-options` field in `test-suite doctests` to pass additional flags to the `doctest`. @@ -108,6 +117,32 @@ * If you use the default `.` in `hs-source-dirs`, then running `doctests` might fail with weird errors (ambigious module errors). Workaround is to move sources under `src/` or some non-top-level directory.++* `extensions:` field isn't supported. Upgrade your `.cabal` file to use at least+ `cabal-version: >= 1.10` and use `default-extensions` or `other-extensions`.++* If you use QuickCheck properties (`prop>`) in your doctests,+ the `test-suite doctest` should depend on `QuickCheck` and `template-haskell`.+ This is a little HACK: These dependencies aren't needed to build the+ `doctests` test-suite executable. However, as we let `Cabal` resolve+ dependencies, we can pass the resolved (and installed!) package identifiers to+ to the `doctest` command. This way, `QuickCheck` and `template-haskell` are+ available to `doctest`, otherwise you'll get errors like:++```+ Variable not in scope:+ mkName+ :: [Char]+ -> template-haskell-2.11.1.0:Language.Haskell.TH.Syntax.Name+```++or++```+ Variable not in scope:+ polyQuickCheck+ :: Language.Haskell.TH.Syntax.Name -> Language.Haskell.TH.Lib.ExpQ+``` Copyright ---------
cabal-doctest.cabal view
@@ -1,5 +1,5 @@ name: cabal-doctest-version: 1.0.2+version: 1.0.3 synopsis: A Setup.hs helper for doctests running description: Currently (beginning of 2017), there isn't @cabal doctest@
src/Distribution/Extra/Doctest.hs view
@@ -227,6 +227,8 @@ rewriteFile (testAutogenDir </> "Build_doctests.hs") $ unlines [ "module Build_doctests where" , ""+ , "import Prelude"+ , "" -- -package-id etc. flags , "pkgs :: [String]" , "pkgs = " ++ (show $ formatDeps $ testDeps libcfg suitecfg)