我正在尝试使用HUnit为我的Haskell / Cabal包创建一个测试套件,并且在运行cabal测试时出现以下错误:
matthew@matthew-Gnawty:~/backup/projects/apollo$ cabal test
Re-configuring with test suites enabled. If this fails, please run configure
manually.
Resolving dependencies...
Configuring apollo-0.1.0.0...
cabal: At least the following dependencies are missing:
hunit >=1.2 && <1.4
我已经运行'cabal hunit'来安装hunit . 为了检查它是否已经安装,我运行了“ghc-pkg list HUnit”,它返回:
matthew@matthew-Gnawty:~/backup/projects/apollo$ ghc-pkg list HUnit
/var/lib/ghc/package.conf.d
HUnit-1.2.5.2
/home/matthew/.ghc/x86_64-linux-7.6.3/package.conf.d
HUnit-1.3.1.1
为什么cabal配置不正确?
我试过了:
要确保cabal通过指定build-depends注释为全局(1.2.5.2)版本或本地(1.3.1.1)版本:
build-depends: base >=4.6 && <4.7,
hunit >=1.2 && <1.4
在我的[packagename] .cabal文件中 .
我也注意到https://www.haskell.org/cabal/FAQ.html#runghc-setup-complains-of-missing-packages,并且不理解那里给出的解释,以及Setup.hs是如何相关的 .
我的Setup.hs文件仅包含
import Distribution.Simple
main = defaultMain
我尝试将'import Test.HUnit'添加到Setup.hs文件中:
import Distribution.Simple
import Test.HUnit
main = defaultMain
使用此Setup.hs运行'cabal test'会产生相同的错误 .
1 回答
这个问题似乎可以通过将亨特资本化为HUnit来解决,即改变
至