summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Pesto.cabal7
-rw-r--r--src/Test.lhs3
2 files changed, 6 insertions, 4 deletions
diff --git a/Pesto.cabal b/Pesto.cabal
index 9be1d12..ee349e7 100644
--- a/Pesto.cabal
+++ b/Pesto.cabal
@@ -19,7 +19,7 @@ library
exposed-modules: Codec.Pesto, Codec.Pesto.Parse, Codec.Pesto.Graph, Codec.Pesto.Lint, Codec.Pesto.Serialize
-- other-modules:
-- other-extensions:
- build-depends: base >=4.6 && <4.7
+ build-depends: base >=4.6 && <4.7, HUnit, parsec
hs-source-dirs: src
default-language: Haskell2010
@@ -29,11 +29,12 @@ executable pesto
default-language: Haskell2010
build-depends: base >=4.6 && <4.7, HUnit, parsec
-executable pesto-test
+test-suite pesto-test
+ type: exitcode-stdio-1.0
main-is: Test.lhs
hs-source-dirs: src
default-language: Haskell2010
- build-depends: base >=4.6 && <4.7, HUnit, parsec
+ build-depends: base >=4.6 && <4.7, Pesto, HUnit, parsec
executable pesto-doc
main-is: Doc.lhs
diff --git a/src/Test.lhs b/src/Test.lhs
index 852c700..68f1831 100644
--- a/src/Test.lhs
+++ b/src/Test.lhs
@@ -4,6 +4,7 @@ Running tests
.. class:: nodoc
> import Test.HUnit
+> import System.Exit (exitFailure, exitSuccess)
> import Codec.Pesto.Parse (test)
> import Codec.Pesto.Lint (test)
> import Codec.Pesto.Graph (test)
@@ -11,7 +12,7 @@ Running tests
The testcases can be run with ``cabal run pesto-test``. This runs *all*
testcases from all modules and prints a summary.
-> main = runTestTT tests
+> main = runTestTT tests >>= \c -> if errors c + failures c > 0 then exitFailure else exitSuccess
> tests = TestList [
> "parse" ~: Codec.Pesto.Parse.test