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
source share