与Haskell's Cabal整合单元测试的当前状态? [英] Current state of integrating unit tests with Haskell's Cabal?

查看:116
本文介绍了与Haskell's Cabal整合单元测试的当前状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我谷歌如何整合与cabal文件的单元测试时,我要么找到



如何使用cabal运行所有单元测试(例如,每次我做cabal build)? ol>

  • 请确保您安装了最新版本的Cabal和cabal-install。

  • $ c> test-suite 部分放在 .cabal 文件中。请参阅cabal文档的本节,了解如何编写在您的Cabal文件中 test-suite 部分和本节,了解如何运行它。 内置的测试支持已经有一段时间了,它使我不必为维护测试而维护脆弱的Makefiles。在 cabal test 的命令行输出中仍然存在一些粗糙的边缘,但是它们已经在HEAD中修复,因此在下一个Cabal / cabal-install版本中,一切都应该非常流畅。


    When i google for how to integrate unit tests with cabal files, i either find

    How would you run all unit test using cabal (for example everytime i do a "cabal build") today?

    解决方案

    1. Make sure you have the latest version of Cabal and cabal-install installed.

    2. Have a test-suite section in your .cabal file. See this section of cabal's documentation for an explanation of how to write a test-suite section in your Cabal file and this section for instructions on how to run it.

    I've been using the built-in test support for some time and it has saved me from having to maintain fragile Makefiles just for my tests. There are still some rough edges in the command line output of cabal test, but they have been fixed in HEAD so in the next Cabal/cabal-install release everything should be very smooth.

    这篇关于与Haskell's Cabal整合单元测试的当前状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆