Reputation:
I have a top level file called Datatypes.hs
. It's exposed in my cabal file.
library
exposed-modules: Application
Foundation
Import
Settings
Settings.Development
Datatypes
Handler.Advise
I'd like to use Datatypes
in my test code. Here's what I have tried
test-suite test type: exitcode-stdio-1.0 main-is: tests/testclient.hs hs-source-dirs: .,tests ghc-options: -Wall
build-depends: base
, Datatypes
, conduit == 0.5.2.7
, attoparsec-conduit == 0.5.0.2
, transformers == 0.3.0.0
, resourcet == 0.4.0.2
, http-conduit >= 1.5 && < 1.7
, utf8-string == 0.3.7
, aeson == 0.6.0.2
I still get complaints about datatypes in testclient.hs not being defined. Is what I am doing possible? For now I will just paste in my data types into testclient.hs, but I'd like to just be able to refer to Datatypes.hs
Upvotes: 2
Views: 66
Reputation: 15078
You can't list individual modules in the build-depends
field - use the name of your package instead. For an example, look at the .cabal
file for unordered-containers
:
test-suite strictness-properties
hs-source-dirs: tests
main-is: Strictness.hs
type: exitcode-stdio-1.0
build-depends:
base,
[...]
unordered-containers
Upvotes: 2