Testing with HTF

守給你的承諾、 提交于 2019-12-18 03:59:08

问题


There's an incredible lack of decent documentation on HTF. All I could find was a Tutorial which doesn't provide any of the following really important information:

  1. How do I create a test suite that automatically executes all tests from packages?
  2. What exactly are those "Black box tests" of HTF and how do I create them?
  3. What are the actual standards of setting up a test suite based on HTF (source root, packages and modules structure, cabal)?

回答1:


The new release 0.9.0.0 of HTF (see http://hackage.haskell.org/package/HTF-0.9.0.0 and https://github.com/skogsbaer/HTF/) hopefully answers all your questions. I'll summarize:

  • Answer to question 1: See the tutorial, http://hackage.haskell.org/packages/archive/HTF/0.9.0.0/doc/html/Test-Framework-Tutorial.html. It explains how to setup a main module that executes all tests defined in your package, see the section "Test definitions in multiple modules"

  • Answer to question 2: The documentation of the BlackBoxTest module http://hackage.haskell.org/packages/archive/HTF/0.9.0.0/doc/html/Test-Framework-BlackBoxTest.html now explains in detail what a black box test is and how to use it.

  • Answer to question 3: The HTF repository at https://github.com/skogsbaer/HTF/ now contains a sample directory with a complete sample project.



来源:https://stackoverflow.com/questions/8919556/testing-with-htf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!