on master help sign in
Make bin/test reload automatically
commit9c317ad0730be250c16ca1787545e558bd9a6bb3 authorSridhar Ratnakumar <srid@srid.ca> dateWed 19 Aug 2020, 20:00 (6 years ago) parentd976477
2 files changed+30−56
README.md+3−1 jrec.cabal+27−55
README.md+3−1
@@ -26,7 +26,9 @@ IDE support is available inside `nix-shell`. For example, if you use VS Code, yo
2626nix-shell --run "code ."
2727```
2828
29−Run tests inside ghcid using `bin/test`.
29+### Tests
30+
31+Run `bin/test` for fast-reloading tests. When library sources change, the test script will reload instantly and re-run the tests.
3032
3133## TODOs
3234
jrec.cabal+27−55
@@ -1,11 +1,11 @@
1−cabal-version: >=1.10
1+cabal-version: 2.4
22name: jrec
33version: 0.1.0.0
44synopsis: anonymous records for busy people
55
66-- description:
7−-- bug-reports:
8−license: BSD3
7+bug-reports: https://github.com/juspay/jrec/issues
8+license: BSD-3-Clause
99license-file: LICENSE
1010author: Artyom Kazak
1111maintainer: artyom.kazak@juspay.in
@@ -17,44 +17,10 @@ extra-source-files:
1717 CHANGELOG.md
1818 README.md
1919
20−library
21− hs-source-dirs: src
22− exposed-modules:
23− JRec
24− JRec.Internal
25− other-modules:
26− JRec.Tuple
27− JRec.Field
28−
29− default-extensions:
30− BlockArguments
31− DataKinds
32− DeriveGeneric
33− DerivingStrategies
34− DuplicateRecordFields
35− FlexibleContexts
36− FlexibleInstances
37− FunctionalDependencies
38− GADTs
39− InstanceSigs
40− KindSignatures
41− LambdaCase
42− MultiParamTypeClasses
43− OverloadedLabels
44− OverloadedStrings
45− PatternSynonyms
46− RankNTypes
47− ScopedTypeVariables
48− StandaloneDeriving
49− TupleSections
50− TypeFamilies
51− TypeOperators
52− UndecidableInstances
53− UnicodeSyntax
54− ViewPatterns
55− ConstraintKinds
56− PackageImports
57−
20+-- A common stanza to share with tests, so that ghcid (bin/test) will reload
21+-- instantly when the library sources change (without us having to restart it).
22+common library-common
23+ default-language: Haskell2010
5824 build-depends:
5925 aeson
6026 , base >=4.13 && <4.15
@@ -68,20 +34,6 @@ library
6834 , lens
6935 , mtl
7036 , text
71−
72− default-language: Haskell2010
73−
74−test-suite jrec-test
75− type: exitcode-stdio-1.0
76− hs-source-dirs: test
77− main-is: Spec.hs
78− build-depends:
79− base,
80− hspec,
81− QuickCheck,
82− lens,
83− jrec
84− default-language: Haskell2010
8537 default-extensions:
8638 BlockArguments
8739 DataKinds
@@ -109,5 +61,25 @@ test-suite jrec-test
10961 UnicodeSyntax
11062 ViewPatterns
11163 ConstraintKinds
64+ PackageImports
11265
66+library
67+ import: library-common
68+ hs-source-dirs: src
69+ exposed-modules:
70+ JRec
71+ JRec.Internal
72+ other-modules:
73+ JRec.Tuple
74+ JRec.Field
11375
76+test-suite jrec-test
77+ import: library-common
78+ type: exitcode-stdio-1.0
79+ hs-source-dirs: test, src
80+ main-is: Spec.hs
81+ build-depends:
82+ base,
83+ hspec,
84+ QuickCheck,
85+ lens