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
Rather annoyingly, if doctests is part of a testsuite it (sometimes) fails to properly run:
$ cabal test
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
- example-0.0.0 (test:doctests) (ephemeral targets)
Preprocessing test suite 'doctests' for example-0.0.0..
Building test suite 'doctests' for example-0.0.0..
Running 1 test suites...
Test suite doctests: RUNNING...
Could not import module: Example. This can be caused by a number of issues:
1. A module found by GHC contained tests, but was not in 'exposed-modules'.
2. For Cabal users: Cabal did not generate a GHC environment file. Either:
* Run with '--write-ghc-environment-files=always'
* Add 'write-ghc-environment-files: always' to your cabal.project
3. The testsuite executable does not have a dependency on your project library. Please add it to the 'build-depends' section of the testsuite executable.
See the example project at https://github.com/martijnbastiaan/doctest-parallel/blob/main/example/README.md for more information.
Examples: 2 Tried: 0 Errors: 1 Unexpected output: 0
Test suite doctests: FAIL
Test suite logged to:
/home/martijn/code/doctest-parallel/example/dist-newstyle/build/x86_64-linux/ghc-8.10.7/example-0.0.0/t/doctests/test/example-0.0.0-doctests.log
0 of 1 test suites (0 of 1 test cases) passed.
cabal: Tests failed for test:doctests from example-0.0.0.
Running it with run works just fine though:
$ cabal run doctests
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
- example-0.0.0 (test:doctests) (additional components to build)
Preprocessing test suite 'doctests' for example-0.0.0..
Building test suite 'doctests' for example-0.0.0..
Examples: 2 Tried: 2 Errors: 0 Unexpected output: 0
This seems to be the same issue observed by #9. My guess is that environment files get written out "too late". My evidence is that this works:
cabal test# fails
cabal test# works
or:
cabal run doctests # works
cabal test# now also works
or:
cabal build
cabal test
The text was updated successfully, but these errors were encountered:
Workaround
or
Issue
Rather annoyingly, if
doctests
is part of a testsuite it (sometimes) fails to properly run:Running it with
run
works just fine though:This seems to be the same issue observed by #9. My guess is that environment files get written out "too late". My evidence is that this works:
or:
or:
cabal build cabal test
The text was updated successfully, but these errors were encountered: