I am glad to announce the first public release of test-framework-golden — a
golden testing library.

Hackage: http://hackage.haskell.org/package/test-framework-golden
GitHub:  https://github.com/feuerbach/test-framework-golden

Golden tests are similar to unit tests (as implemented in HUnit), but the idea
is to store the expected result in files (called «golden» files).

I was introduced to the idea of golden testing by Bohdan Vlasyuk at ZuriHac in
2010. Since then I've discovered that this is a nice approach and it is already
used in variety of projects (e.g. ghc, haddock).

Surprisingly, not much is written about golden testing, and I've been unable to
find any golden testing libraries for Haskell or any other programming language.
Every project has its own ad-hoc implementation in Haskell/Python/Shell/etc.

The closest match on the market is Simon Michael's shelltestrunner. But to use
it you have to expose the tested functionality via command line, which may be
inconvenient.

So this is my attempt at a general golden testing library.

It consists of two modules.
Test.Golden has a simple interface that helps you get started very quickly. 
Test.Golden.Advanced provides a very generic testing function that you can use
to implement the testing system you dream about.

The library is integrated with test-framework, so you can use golden tests in
addition to SmallCheck/QuickCheck/HUnit tests.

In future there's a plan to support some golden test management capabilities.

Roman

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to