]> gitweb.michael.orlitzky.com - hath.git/commitdiff
Use Cabal test integration.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 21 Apr 2013 16:41:57 +0000 (12:41 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 21 Apr 2013 16:41:57 +0000 (12:41 -0400)
hath.cabal
makefile
test/TestSuite.hs

index ee3615a41eb42ee1d97ff6d6a93fcbe1e02b2431..23f6cc47724ed7432f960e9ff526a3eb0e847f27 100644 (file)
@@ -47,3 +47,42 @@ executable hath
     -prof
     -auto-all
     -caf-all
+
+
+test-suite testsuite
+  type: exitcode-stdio-1.0
+  hs-source-dirs: src test
+  main-is: TestSuite.hs
+  build-depends:
+    base                        == 4.*,
+    HUnit                       == 1.2.*,
+    QuickCheck                  == 2.6.*,
+    test-framework              == 0.8.*,
+    test-framework-hunit        == 0.3.*,
+    test-framework-quickcheck2  == 0.3.*
+
+  -- It's not entirely clear to me why I have to reproduce all of this.
+  ghc-options:
+    -Wall
+    -fwarn-hi-shadowing
+    -fwarn-missing-signatures
+    -fwarn-name-shadowing
+    -fwarn-orphans
+    -fwarn-type-defaults
+    -fwarn-tabs
+    -fwarn-incomplete-record-updates
+    -fwarn-monomorphism-restriction
+    -fwarn-unused-do-bind
+    -funbox-strict-fields
+    -fexcess-precision
+    -fno-spec-constr-count
+    -rtsopts
+    -threaded
+    -optc-O3
+    -optc-march=native
+    -O2
+
+source-repository head
+  type: git
+  location: http://michael.orlitzky.com/git/hath.git
+  branch: master
index 50dda0fb4fc5a7c639a07373f0a35620d48e2855..2d46895cc0c020349e2e9a5d55b2dcb6a330fc5b 100644 (file)
--- a/makefile
+++ b/makefile
@@ -1,6 +1,9 @@
+BIN           = dist/build/hath/hath
+TESTSUITE_BIN = dist/build/testsuite/testsuite
+
 .PHONY : test
 
-hath: src/*.hs
+$(BIN): src/*.hs
        runghc Setup.hs clean
        runghc Setup.hs configure --user
        runghc Setup.hs build
@@ -13,8 +16,13 @@ profile: src/*.hs
 clean:
        runghc Setup.hs clean
 
-test:
-       runghc -i"src" test/TestSuite.hs
+
+$(TESTSUITE_BIN): src/*.hs test/TestSuite.hs
+       runghc Setup.hs configure --user --flags=${FLAGS} --enable-tests
+       runghc Setup.hs build
+
+test: $(BIN) $(TESTSUITE_BIN)
+       runghc Setup.hs test
 
 dist:
        runghc Setup.hs configure
index 3085c1b38f014eefc9b654a2a9caa381e3ed1bc1..406fec5b337ed89b0797ee6141b5ecea802e7ac5 100644 (file)
@@ -1,20 +1,11 @@
 {-# LANGUAGE NoMonomorphismRestriction #-}
 import Data.Monoid (mempty)
 import Test.Framework (
-  RunnerOptions(),
   Test,
-  TestName,
-  TestOptions(),
   defaultMainWithOpts,
-  testGroup
   )
 import Test.Framework.Options
 import Test.Framework.Runners.Options
-import Test.Framework.Providers.API (TestName)
-import Test.Framework.Providers.HUnit (testCase)
-import Test.Framework.Providers.QuickCheck2 (testProperty)
-import Test.HUnit
-import Test.QuickCheck (Testable ())
 
 import Cidr (cidr_properties, cidr_tests)