Skip to content

Commit

Permalink
Reconfigured cabal file to use new Cabal test framework.
Browse files Browse the repository at this point in the history
Now run tests with

cabal configure --enable-tests
cabal build
cabal test
  • Loading branch information
jgm committed Feb 2, 2013
1 parent de51b0d commit 3006c79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
10 changes: 1 addition & 9 deletions Setup.lhs
@@ -1,11 +1,3 @@
#!/usr/bin/env runhaskell
> import Distribution.Simple
> import System.Process
> import System.Exit

> main = defaultMainWithHooks $ simpleUserHooks { runTests = runTestSuite }

Run test suite.

> runTestSuite _ _ _ _ = runCommand "./dist/build/test-filestore/test-filestore" >>= waitForProcess >>= exitWith

> main = defaultMain
19 changes: 6 additions & 13 deletions filestore.cabal
@@ -1,6 +1,6 @@
Name: filestore
Version: 0.6
Cabal-version: >= 1.8
Cabal-Version: >= 1.10
Build-type: Custom
Synopsis: Interface for versioning file stores.
Description: The filestore library provides an abstract interface for a versioning
Expand All @@ -21,10 +21,6 @@ Source-repository head
type: git
location: git://github.com/jgm/filestore.git

Flag tests
default: False
description: Build test suite

Flag maxcount
default: True
description: Make use of a recent (>= 2.3.0) Darcs feature which vastly improves the performance
Expand Down Expand Up @@ -52,24 +48,21 @@ Library
Other-modules: Paths_filestore,
Data.FileStore.DarcsXml,
Data.FileStore.MercurialCommandServer
extensions: FlexibleInstances, CPP

Default-Extensions: FlexibleInstances, CPP
Default-Language: Haskell98
if flag(maxcount)
cpp-options: -DUSE_MAXCOUNT
extensions: CPP
if impl(ghc >= 6.12)
Ghc-Options: -Wall -fno-warn-unused-do-bind
else
Ghc-Options: -Wall
Ghc-Prof-Options: -auto-all

Executable test-filestore
if flag(tests)
Buildable: True
else
Buildable: False
Test-suite test-filestore
Type: exitcode-stdio-1.0
Hs-source-dirs: tests
Main-is: Tests.lhs
Default-Language: Haskell98
Build-depends: base >= 4 && < 5,
HUnit >= 1.2 && < 1.3,
mtl,
Expand Down

0 comments on commit 3006c79

Please sign in to comment.