Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pbrisbin/cabal-test-hunit
Interface to run HUnit tests via Cabal 1.16
https://github.com/pbrisbin/cabal-test-hunit
Last synced: 2 months ago
JSON representation
Interface to run HUnit tests via Cabal 1.16
- Host: GitHub
- URL: https://github.com/pbrisbin/cabal-test-hunit
- Owner: pbrisbin
- License: bsd-3-clause
- Created: 2013-03-08T14:09:42.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2016-04-30T14:26:26.000Z (over 8 years ago)
- Last Synced: 2024-10-04T17:38:32.722Z (3 months ago)
- Language: Haskell
- Size: 7.81 KB
- Stars: 10
- Watchers: 6
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cabal-test-hunit
Interface for running HUnit tests via Cabal 1.16.
**DEPRECATED**: I no longer use this, and very much prefer HSpec. Therefore:
- You will see no active development here, though I'm happy to merge PRs
- I will not be publishing this to Hackage, though I'd be fine with someone else doing so## Installation
~~~
git clone ... && cd ... && cabal install
~~~## Usage
Add a suite to your cabal file:
~~~
Test-Suite test-your-thing
type: detailed-0.9
test-module: Test.YourTestModule
build-depends: base
, Cabal
, HUnit
, cabal-test-hunit
~~~Write some tests in `Test.YourTestModule`:
~~~ { .haskell }
import Test.HUnitimport qualified Distribution.TestSuite as C
import qualified Distribution.TestSuite.HUnit as Htests :: IO [C.Test]
tests = return $ map (uncurry H.test) testCasestestCases :: [(String, Test)]
testCases = [("Truth tests", truthTest)]truthTest :: Test
truthTest = TestCase $ assertEqual "True is true" True True
~~~Run them:
~~~
cabal configure --enable-tests
cabal build
cabal test
~~~## Prior work
An early version of this module, written by Thomas Tuegel in 2010, can
be found in [this][cth] darcs repo.[cth]: http://community.haskell.org/~ttuegel/cabal-test-hunit
This file shares no code with that one, as the changes in Cabal 1.16
required it be entirely rewritten. I've retained Thomas' LICENSE but
removed his copyright; I hope that's appropriate.