Skip to content

Instantly share code, notes, and snippets.

@yanatan16
Created January 7, 2014 21:31
Show Gist options
  • Save yanatan16/8307247 to your computer and use it in GitHub Desktop.
Save yanatan16/8307247 to your computer and use it in GitHub Desktop.
A cabal-dev workflow
name: sample
version: 0.1.0.0
-- synopsis:
-- description:
-- homepage:
-- license:
-- license-file:
-- author:
-- maintainer:
-- copyright:
-- category:
stability: experimental
build-type: Simple
cabal-version: >=1.8
-- This is where the magic happens
flag developer
description: operate in developer mode
default: False
-- Your usual test suite
test-suite tests
type: exitcode-stdio-1.0
main-is: tests/Main.hs
hs-source-dirs: tests
other-modules: Test.Test
build-depends: sample, base
test-framework >= 0.2.0,
test-framework-quickcheck2 >= 0.2.0, QuickCheck >= 2,
test-framework-hunit >= 0.2.0, HUnit >= 1.2 && < 2
library
exposed-modules: Data.YourModule
hs-source-dirs: src
build-depends: base
if flag(developer)
hs-source-dirs: tests
other-modules: Test.Test
build-depends: test-framework >= 0.2.0,
test-framework-quickcheck2 >= 0.2.0, QuickCheck >= 2,
test-framework-hunit >= 0.2.0, HUnit >= 1.2 && < 2
cabal-dev configure --flags=developer
cabal-dev build
cabal-dev ghci

> import Test.Test
> runTests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment