git.iko.soy/typeable/openapi3
on master help sign in
Try Custom build
d722fa4Oleg Grenrus
Setup.hs+31
@@ -1,2 +1,33 @@
1+{-# LANGUAGE CPP #-}
2+{-# OPTIONS_GHC -Wall #-}
3+module Main (main) where
4+
5+#ifndef MIN_VERSION_cabal_doctest
6+#define MIN_VERSION_cabal_doctest(x,y,z) 0
7+#endif
8+
9+#if MIN_VERSION_cabal_doctest(1,0,0)
10+
11+import Distribution.Extra.Doctest ( defaultMainWithDoctests )
12+main :: IO ()
13+main = defaultMainWithDoctests "doctests"
14+
15+#else
16+
17+#ifdef MIN_VERSION_Cabal
18+-- If the macro is defined, we have new cabal-install,
19+-- but for some reason we don't have cabal-doctest in package-db
20+--
21+-- Probably we are running cabal sdist, when otherwise using new-build
22+-- workflow
23+#warning You are configuring this package without cabal-doctest installed. \
24+ The doctests test-suite will not work as a result. \
25+ To fix this, install cabal-doctest before configuring.
26+#endif
27+
1import Distribution.Simple
28import Distribution.Simple
29+
30+main :: IO ()
2main = defaultMain
31main = defaultMain
32+
33+#endif
swagger2.cabal+7−3
@@ -10,7 +10,7 @@ author: Nickolay Kudasov
10maintainer: nickolay@getshoptv.com
10maintainer: nickolay@getshoptv.com
11copyright: (c) 2015-2016, GetShopTV
11copyright: (c) 2015-2016, GetShopTV
12category: Web
12category: Web
13−build-type: Simple
13+build-type: Custom
14extra-source-files:
14extra-source-files:
15 README.md
15 README.md
16 , CHANGELOG.md
16 , CHANGELOG.md
@@ -19,6 +19,10 @@ extra-source-files:
19cabal-version: >=1.10
19cabal-version: >=1.10
20tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.1
20tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.1
21
21
22+custom-setup
23+ setup-depends:
24+ base, Cabal, cabal-doctest >=1.0.2 && <1.1
25+
22library
26library
23 hs-source-dirs: src
27 hs-source-dirs: src
24 include-dirs: include
28 include-dirs: include
@@ -93,11 +97,11 @@ test-suite spec
93 Data.Swagger.Schema.ValidationSpec
97 Data.Swagger.Schema.ValidationSpec
94 default-language: Haskell2010
98 default-language: Haskell2010
95
99
96−test-suite doctest
100+test-suite doctests
97 build-depends: base, doctest, Glob
101 build-depends: base, doctest, Glob
98 default-language: Haskell2010
102 default-language: Haskell2010
99 hs-source-dirs: test
103 hs-source-dirs: test
100− main-is: DocTest.hs
104+ main-is: doctests.hs
101 type: exitcode-stdio-1.0
105 type: exitcode-stdio-1.0
102
106
103source-repository head
107source-repository head
test/DocTest.hsdeleted−8
@@ -1,8 +0,0 @@
1−module Main (main) where
2−
3−import System.FilePath.Glob (glob)
4−import Test.DocTest (doctest)
5−
6−main :: IO ()
7−main = glob "src/**/*.hs" >>= doctest'
8− where doctest' files = doctest $ "-Iinclude/" : "-D__DOCTEST__" : files
test/doctests.hsnew file+12
@@ -0,0 +1,12 @@
1+module Main where
2+
3+import Build_doctests (flags, pkgs, module_sources)
4+import Data.Foldable (traverse_)
5+import Test.DocTest
6+
7+main :: IO ()
8+main = do
9+ traverse_ putStrLn args
10+ doctest args
11+ where
12+ args = flags ++ pkgs ++ module_sources