bin/test: run test, and reload on library change (#32)

* test script now runs on test file update

* added src to cabal tests to get auto reload

* fixed formatting

* removed unneeded test dependency

* fixed cabal formatting issue

* Remove library stanza; no longer needed

* hs-source-dirs belongs to shared

Because we are sharing 'src'

* Fix compilation

* Move other-modules as well.

Co-authored-by: Sridhar Ratnakumar <srid@srid.ca>
This commit is contained in:
EvanPiro 2022-08-08 11:02:43 -04:00 committed by GitHub
parent 1aa9e81142
commit df6efcff60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 12 deletions

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash
set -xe
exec nix develop -c ghcid -c "cabal repl test:tests"
exec nix develop -c ghcid -c "cabal repl test:tests" -T :main

View file

@ -91,23 +91,17 @@ common shared
, time
, with-utf8
hs-source-dirs: src
other-modules: Lib
executable haskell-template
import: shared
main-is: Main.hs
hs-source-dirs: src
default-language: Haskell2010
other-modules: Lib
library
import: shared
exposed-modules: Lib
hs-source-dirs: src
test-suite tests
import: shared
main-is: Main.hs
main-is: Spec.hs
type: exitcode-stdio-1.0
hs-source-dirs: tests
build-depends:
, haskell-template
, hspec
build-depends: hspec