Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

jstolarek/haskell-testing-stub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

haskell-testing-stub

IMPORTANT: This repository is now hosted on BitBucket.

This stub project demonstrates how to organize code tests and benchmarks in a Haskell project. It shows how to:

  • separate tests and benchmarks from the actual code, so that users don't need to install testing and benchmarking libraries
  • use cabal to automate testing and benchmarking
  • use tasty to create a coherent test suite containing both HUnit and QuickCheck tests
  • create QuickCheck tests that run with many different test data sets.
  • use criterion to create benchmarks

Visit my blog for a detailed discussion of code testing and benchmarking in Haskell. See also comments in the source code.

Running tests

Execute these commands to compile and run tests:

cabal configure --enable-tests
cabal build
cabal test

Running benchmarks

Execute these commands to compile and run benchmarks:

cabal configure --enable-benchmarks
cabal build
cabal bench

Compiling the library

Execute these commands to install the library without benchmarking and testing code:

cabal configure
cabal build
cabal install

About

Stub project showing how to organize tests and benchmarks in Haskell

Resources

License

Stars

Watchers

Forks

Packages

No packages published