I have a fairly simple haskell project set up, where I just want to have the framework working with testing and so on before I actually start coding. I have my source files for an executable in a /src
directory (where /
is the project's root) and my tests in a /testsuite
directory. /testsuite
contains a simple test file called TestSuite.hs
with main = Test.Framework.defautMain tests
as the implementation of main. The problem is, when I run
cabal clean && cabal configure --enable-tests && cabal build
I get the warning
output was redirected with -o, but no output will be generated because there is no main module.
The build works fine when I don't specify --enable-tests
. My cabal file is:
Name: Example
Version: 0.1
Synopsis: Synopsis
Description:
Long description.
License: GPL
License-File: LICENSE
Author: SeanK
Maintainer: [email protected]
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
I have QuickCheck disabled because I'm not using (==>) at the moment, which is the only function I currently need from it. The rest should be straight-forward. Any help would be greatly appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…