Sea*_*her 10 testing haskell build cabal
我有一个相当简单的haskell项目设置,我只想让框架在我开始编码之前使用测试等等.我有一个/src目录中可执行文件的源文件(/项目的根目录)和我在/testsuite目录中的测试./testsuite包含称为一个简单的测试文件,TestSuite.hs以main = Test.Framework.defautMain tests作为主要的执行.问题是,当我跑步时
cabal clean && cabal configure --enable-tests && cabal build
Run Code Online (Sandbox Code Playgroud)
我收到了警告
output was redirected with -o, but no output will be generated because there is no main module.
Run Code Online (Sandbox Code Playgroud)
我没有指定时,构建工作正常--enable-tests.我的cabal文件是:
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
Run Code Online (Sandbox Code Playgroud)
我已禁用QuickCheck,因为我目前没有使用(==>),这是我目前唯一需要的功能.其余的应该是直截了当的.任何帮助将不胜感激.
Fed*_*lev 17
你应该在你定义的模块名称TestSuite.hs文件Main,像有例如.
Haskell 98报告引用:
Haskell程序是模块的集合,按照惯例,其中一个必须被称为Main,并且必须导出值main.