/testloop

Instant test feedback loop on haskell projects

Primary LanguageHaskellMIT LicenseMIT

TestLoop

TestLoop is a library that provides an automated execution and reloading of a cabal's test-suites whenever a haskell file is modified.

NOTE: To get started quickly check the project in the examples folder.

Usage

Once you have a test suite using a haskell test library (hspec, HUnit, test-framework, etc), write the following in your project's cabal file:

test-suite tests
  type: exitcode-stdio-1.0
  hs-source-dirs: src, test
  main-is: TestSuite.hs
  -- configuration for your testsuite here

executable testloop
  main-is: TestLoop.hs
  -- all your project sources (+tests) directores
  hs-source-dirs: src, test
  build-depends:
    base             == 4.6.*,
    -- your project + test dependencies
    testloop         == 0.1.*

And in the test/TestLoop.hs file:

module Main where

import System.TestLoop (setupTestLoop)

main :: IO ()
main = setupTestLoop

Install and run your TestLoop, as soon as you start editing your source files it will automatically compile and run your tests, instant feedback FTW.

Note: Currently TestLoop expects you to have your tests in a test folder