【发布时间】:2012-08-26 19:44:46
【问题描述】:
我有一个相当简单的 haskell 项目设置,我只想让框架在我真正开始编码之前进行测试等工作。我在/src 目录(其中/ 是项目的根目录)中有可执行文件的源文件,在/testsuite 目录中有我的测试。 /testsuite 包含一个名为 TestSuite.hs 的简单测试文件,main = Test.Framework.defautMain tests 作为 main 的实现。问题是,当我运行时
cabal clean && cabal configure --enable-tests && cabal build
我收到警告
output was redirected with -o, but no output will be generated because there is no main module.
当我不指定 --enable-tests 时,构建工作正常。我的阴谋文件是:
Name: Example
Version: 0.1
Synopsis: Synopsis
Description:
Long description.
License: GPL
License-File: LICENSE
Author: SeanK
Maintainer: email@example.com
Category: Development
Build-Type: Simple
Cabal-Version: >= 1.8
Test-Suite test
Type: exitcode-stdio-1.0
Main-Is: TestSuite.hs
Build-Depends: base >= 3 && < 5,
test-framework,
test-framework-quickcheck
-- QuickCheck
Hs-Source-Dirs: src,
testsuite
Executable example
Main-Is: Main.hs
-- Other-Modules:
Build-Depends: base >= 3 && < 5,
haskell98
Hs-Source-Dirs: src
Ghc-Options: -Wall
我已禁用 QuickCheck,因为我目前没有使用 (==>),这是我目前需要的唯一功能。其余的应该是直截了当的。任何帮助将不胜感激。
【问题讨论】:
标签: testing haskell build cabal