Cabal tests on windows 7

I am trying to follow the examples given here http://www.haskell.org/cabal/users-guide/#test-suites

When I run the cabal test, it throws this cabal: No test suites enabled. Did you remember to configure with '--enable-tests'? error cabal: No test suites enabled. Did you remember to configure with '--enable-tests'? cabal: No test suites enabled. Did you remember to configure with '--enable-tests'?

so i try cabal configure --enable-tests and then cabal test but now i get

 Running 1 test suites... Test suite test-s3dm: RUNNING... cabal: permission denied 

What am I doing wrong?

+4
source share
2 answers

You still need to build the tests and the program you want to test. therefore, after configuration, you need to perform cabal build .

But I would agree that this error message should be something else.

+3
source

I had the same problem as you. The reason for this was that the test suite file was not compiled into an executable file. It turned out that no matter how I configured it, Cabal did not create executable files for modules located in some namespaces (for example, Pkg.Main ), and complained that it could not find the Main module during the construction phase.

The solution I found was to move both the Main modules and the TestSuite module to the src src/ kernel and remove the module header declarations in these files.

Here's what my working cabal config looks like:

 name: Pwn version: 0.1 cabal-version: >= 1.2 build-type: Simple executable main hs-source-dirs: src main-is: main.hs build-depends: base >= 4 && < 5, random, containers test-suite test-suite hs-source-dirs: src main-is: test-suite.hs build-depends: base >= 4 && < 5, test-framework >= 0.4.1, test-framework-quickcheck, test-framework-hunit type: exitcode-stdio-1.0 
+1
source

Source: https://habr.com/ru/post/1380548/


All Articles