Skip to content

Test suite fails to see executable modules #3242

Closed

Description

@madgen

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).

I appreciate any work around. Thanks!

Activity

  1. 23Skidoo commented on Mar 24, 2016

    @23Skidoo
    Member

    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.

  2. madgen commented on Mar 24, 2016

    @madgen
    Author

    Thank you so much. Exactly what I want. Is there a release schedule?

  3. 23Skidoo commented on Mar 24, 2016

    @23Skidoo
    Member

    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).

  4. madgen commented on Mar 24, 2016

    @madgen
    Author

    I see. Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions