如何使用Cabal在ghcid中运行测试套件? [英] How to run test suite in ghcid with cabal?
本文介绍了如何使用Cabal在ghcid中运行测试套件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 https:/中找到了有关在堆栈中执行此操作的参考/www.parsonsmatt.org/2018/05/19/ghcid_for_the_win.html 并在此处进行一些提及: https://github.com/ndmitchell/ghcid/issues/128
I've found a reference for doing this in stack in https://www.parsonsmatt.org/2018/05/19/ghcid_for_the_win.html and some mention of it here: https://github.com/ndmitchell/ghcid/issues/128
我尝试过的事情:
[nix-shell:~/NewProjects/orgmode-parse]$ cabal v2-repl test
cabal: Cannot open a repl for the package test, it is not in this project
(either directly or indirectly). If you want to add it to the project then
edit the cabal.project file.
[nix-shell:~/NewProjects/orgmode-parse]$ cabal v2-repl Test.test
cabal: Unknown target 'Test.test'.
There is no component 'Test.test'.
[nix-shell:~/NewProjects/orgmode-parse]$ cabal v2-repl Test.test
cabal: Unknown target 'Test.test'.
There is no component 'Test.test'.
推荐答案
ghcid --command='cabal v2-repl test:tests' --test 'Main.main'
其中 tests
是Cabal文件中定义的测试套件的名称. Main.main
是指 Main
模块的 main
函数.
Where tests
is the name of the test-suite defined in the cabal file. And Main.main
refers to the Main
module's main
function.
这篇关于如何使用Cabal在ghcid中运行测试套件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文