Package Info

ghc-HTF


The Haskell Test Framework


Development/Languages/Other

The Haskell Test Framework (/HTF/ for short) lets you define unit tests (<http://hunit.sourceforge.net>), QuickCheck properties (<http://www.cs.chalmers.se/~rjmh/QuickCheck/>), and black box tests in an easy and convenient way. HTF uses a custom preprocessor that collects test definitions automatically. Furthermore, the preprocessor allows HTF to report failing test cases with exact file name and line number information. Additionally, HTF tries to produce highly readable output for failing tests: for example, it colors and pretty prints expected and actual results and provides a diff between the two values.

The documentation of the "Test.Framework.Tutorial" module provides a tutorial for HTF. There is also a slightly out-dated blog article (<http://factisresearch.blogspot.de/2011/10/new-version-of-htf-with-diffs-colors.html>) demonstrating HTF's coloring, pretty-printing and diff functionality.

/HEADS UP, backwards incomatibility with prior versions:/

In version 0.10.0.0, the following changes could break code compiled against version 0.9.*:

  • "Test.Framework" now longer exports all of "Test.Framework.TestManager" and

"Test.Framework.BlackBoxTest". For modules that only define tests, no changes should be necessary. However, you likely need to adjust your test runner module by importing "Test.Framework.TestManager" and possibly "Test.Framework.BlackBoxTest".

  • Some reorganization in "Test.Framework.TestManager" and related modules,

introduction of "Test.Framework.TestTypes". Usually, your code should not be affected by these changes.

Starting with version 0.9.0.0, HTF uses a new strategy for collecting the testcases defined in your project (see "Test.Framework.Tutorial" for a description of this strategy). If you used version 0.8.* or earlier of HTF, this /will break your build!/ However, it's rather easy to bring you project in line with the new HTF version. Here are the steps that will most likely resolve your backwards incompatibility problems:

  • If a module exports the 'allHTFTests' symbol, this export must be changed to

'htf_thisModulesTests'.

  • If an import declaration of some module hides the 'allHTFTests' symbol, you

can simply remove the hiding clause for 'allHTFTests'.

  • If a module collects and executes tests from several other modules, the

collecting module has to be changed as follows: add '&#x7b;-&#x23; OPTIONS_GHC -F -pgmF htfpp &#x23;-&#x7d;' to the top of the collecting module, import the other modules with the '&#x7b;-&#x40; HTF_TESTS &#x40;-&#x7d;' annotation, use the symbol 'htf_importedTests' for referencing the imported tests. See "Test.Framework.Tutorial" for details.


License: LGPL-2.0+
URL: https://hackage.haskell.org/package/HTF

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.13.1.0-bp150.1.3 info GA Release 2018-07-31 15
  • AArch64
  • ppc64le
  • ghc-HTF
  • ghc-HTF-devel
0.13.1.0-bp150.1.5 info GA Release 2018-07-30 15
  • x86-64
  • ghc-HTF
  • ghc-HTF-devel