You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a Haskell project with library, executable, and tests. This worked fine when I list the library as one of the dependencies to the test-suite.
But I no longer wish to export the project as a library as it is not meant to be used as one. This means the test-suite can no longer see the project. I don't think this should ever be the case as the project is the only thing test suite should be testing.
As a work around I tried to list all dependencies of the original project to the test suite and add the source directory next to the test directory. The problem with that is I have a happy file in my project and cabal test cannot deal with that. It says it cannot find the module (meaning it looks at the right directory but never preprocesses the .y file or doesn't look at where the preprocessed file lives).
Basically, what you want is #3022. It will be a part of Cabal 1.26.
As a work around I tried to list all dependencies of the original project to the test suite and add the source directory next to the test directory.
Adding the path to the library's sources to the test suite's hs-source-dirs should work as a workaround (if you're willing to tolerate longer compile times).
The problem with that is I have a happy file in my project and cabal test cannot deal with that. It says it cannot find the module (meaning it looks at the right directory but never preprocesses the .y file or doesn't look at where the preprocessed file lives).
Try adding the .y-generated module to the test-suite's other-modules.
The next Cabal release will be 1.24 (will be out simultaneously with GHC 8 final, i.e. Real Soon Now), and 1.26 will be released ~6 months after that (probably September/October).
Activity
23Skidoo commentedon Mar 24, 2016
Basically, what you want is #3022. It will be a part of Cabal 1.26.
Adding the path to the library's sources to the test suite's
hs-source-dirsshould work as a workaround (if you're willing to tolerate longer compile times).Try adding the
.y-generated module to the test-suite'sother-modules.madgen commentedon Mar 24, 2016
Thank you so much. Exactly what I want. Is there a release schedule?
23Skidoo commentedon Mar 24, 2016
The next Cabal release will be 1.24 (will be out simultaneously with GHC 8 final, i.e. Real Soon Now), and 1.26 will be released ~6 months after that (probably September/October).
madgen commentedon Mar 24, 2016
I see. Many thanks.