问题描述
HTF的体面文件缺乏令人难以置信的表现。我能找到的只有,它不提供以下任何非常重要的信息:
- 如何创建一个自动执行的测试套件所有的软件包测试?
- HTF的黑盒测试究竟是什么,以及如何创建它们?
- 什么是实际标准设置基于HTF(源根,包和模块结构,cabal)的测试套件?
HTF的新版本0.9.0.0(请参阅和)希望能回答你所有的问题。我会总结一下: 对问题1的回答:请参阅教程。它解释了如何设置执行包中定义的所有测试的主模块,请参阅多个模块中的测试定义一节。 回答问题2: BlackBoxTest模块的文档现在详细解释了黑盒测试是什么以及如何使用它。
示例
目录。
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:
- How do I create a test suite that automatically executes all tests from packages?
- What exactly are those "Black box tests" of HTF and how do I create them?
- What are the actual standards of setting up a test suite based on HTF (source root, packages and modules structure, cabal)?
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.
这篇关于用HTF进行测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!