dimanche 29 mars 2015

Problems with Test-Framework and HUnit

I have problems setting up unit-tests with Test-Framework and HUnit.

I have the following imports in my testfile:



import Test.Framework
import Test.Framework.Providers.QuickCheck2
import Test.Framework.Providers.HUnit


When I try to load the file in ghci I get the error-message:



test/MainTestSuite.hs:3:8:
Could not find module ‘Test.Framework.Providers.HUnit’
Perhaps you meant
Test.Framework.Providers.API (from test-framework-0.8.1.1)
Use -v to see a list of the files searched for.
Failed, modules loaded: none.


Only loading Test.Framework and Test.Framework.Providers.QuickCheck2 works and can run the tests. According to cabal test-framework-hunit is installed:



$ cabal install test-framework-hunit
Resolving dependencies...
All the requested packages are already installed:
test-framework-hunit-0.3.0.1
Use --reinstall if you want to reinstall anyway.
Notice: installing into a sandbox located at
/home/XXX/projects/my_project/.cabal-sandbox


Also test-framework-hunit is listed as a dependency in the my_project.cabal-file:



test-suite tests
main-is:
MainTestSuite.hs
type:
exitcode-stdio-1.0
hs-source-dirs:
test,
src
build-depends:
base,
HUnit,
QuickCheck,
test-framework,
test-framework-hunit,
test-framework-quickcheck2,
containers >=0.5 && <0.6
default-language:
Haskell2010


What am I doing wrong? If that matters: I'm installing everything into a cabal-sandbox.


Aucun commentaire:

Enregistrer un commentaire