From 52ed616dd5f1e6d5bb77cfdc45aed16cb1ab62ee Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 24 Jul 2011 15:42:27 +0300 Subject: [PATCH] yesod-core uses cabal test --- yesod-core/Test/Widget.hs | 2 ++ yesod-core/yesod-core.cabal | 25 +++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/yesod-core/Test/Widget.hs b/yesod-core/Test/Widget.hs index 4cd92a5c..b0bff8b2 100644 --- a/yesod-core/Test/Widget.hs +++ b/yesod-core/Test/Widget.hs @@ -21,6 +21,8 @@ data Y = Y mkMessage "Y" "test" "en" +type Strings = [String] + mkYesod "Y" [$parseRoutes| / RootR GET /foo/*Strings MultiR GET diff --git a/yesod-core/yesod-core.cabal b/yesod-core/yesod-core.cabal index 35794f2f..34508a8f 100644 --- a/yesod-core/yesod-core.cabal +++ b/yesod-core/yesod-core.cabal @@ -69,23 +69,24 @@ library if flag(test) Buildable: False -executable runtests +test-suite runtests + type: exitcode-stdio-1.0 if flag(ghc7) + type: exitcode-stdio-1.0 build-depends: base >= 4.3 && < 5 cpp-options: -DGHC7 + main-is: runtests.hs else + type: exitcode-stdio-1.0 build-depends: base >= 4 && < 4.3 - if flag(test) - Buildable: True - cpp-options: -DTEST - build-depends: test-framework, - test-framework-quickcheck2, - test-framework-hunit, - HUnit, - wai-test, - QuickCheck >= 2 && < 3 - else - Buildable: False + main-is: runtests.hs + cpp-options: -DTEST + build-depends: test-framework, + test-framework-quickcheck2, + test-framework-hunit, + HUnit, + wai-test, + QuickCheck >= 2 && < 3 ghc-options: -Wall main-is: runtests.hs