我使用yesod init命令建立了一个yesod脚手架站点,并将我的项目命名为yesodtry。我使用这个命令建立了一个脚手架站点,这是由yesod init提供的
cd yesodtry && cabal sandbox init && cabal install && yesod devel一切进展顺利,我访问了127.0.0.1:3000的演示站点。出于好奇,我尝试尝试使用yesod test命令。这是我得到的输出:
Resolving dependencies...
Configuring yesodtry-0.0.0...
cabal: At least the following dependencies are missing:
hspec -any, yesod-test ==1.2.*看到yesodtry.cabal文件是如何有一个test部分的,我尝试执行cabal build test,这是输出:
cabal: Cannot build the test suite 'test' because test suites are not enabled.
Run configure with the flag --enable-tests好的..。所以它告诉我要运行cabal configure --enable-tests。这是输出:
Resolving dependencies...
Configuring yesodtry-0.0.0...
cabal: At least the following dependencies are missing:
hspec -any, yesod-test ==1.2.*我在yesodtry.cabal中看到了这一行,用于build-depends of test-suite test“节”:
yesod-test >= 1.2 && < 1.3看来,在这里,阴谋集团没有安装依赖项。我该怎么做?
谢谢。
发布于 2013-12-22 02:32:58
好的,我想我在这个哈斯克尔咖啡线上找到了答案。
我们必须这样做:
cabal configure --enable-tests
cabal install --only-dependencies --enable-tests并且将安装test-suite test部分的依赖项。
然后运行yesod test,下面是输出的最后几行:
Linking dist/build/test/test ...
Building yesodtry-0.0.0...
Preprocessing library yesodtry-0.0.0...
In-place registering yesodtry-0.0.0...
Preprocessing test suite 'test' for yesodtry-0.0.0...
Linking dist/build/test/test ...
Running 1 test suites...
Test suite test: RUNNING...
Test suite test: PASS
Test suite logged to: dist/test/yesodtry-0.0.0-test.log
1 of 1 test suites (1 of 1 test cases) passed.希望这对将来遇到同样问题的人有帮助。
https://stackoverflow.com/questions/20725611
复制相似问题