Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cabal-doctest #428

Open
4 of 10 tasks
sol opened this issue Jul 12, 2024 · 3 comments
Open
4 of 10 tasks

Add cabal-doctest #428

sol opened this issue Jul 12, 2024 · 3 comments

Comments

@sol
Copy link
Owner

sol commented Jul 12, 2024

Initial implementation: #425
Based on: https://github.com/mpickering/cabal-doctest-demo/blob/master/cabal-doctest

Related discussions:

TODO:

@hsyl20
Copy link
Contributor

hsyl20 commented Aug 1, 2024

Thanks for your work on this!

I've just noticed that there is an issue when multi-repl: True is present in a cabal.project. The repl loads the target but doesn't run the tests:

Example from https://github.com/haskus/packages/actions/runs/10195092999/job/28203068431:

Run cabal doctest
Resolving dependencies...
Build profile: -w ghc-9.8.2 -O1
In order, the following will be built (use -v for more details):
 - doctest-0.22.9 (lib) (requires build)
 - doctest-0.22.9 (exe:doctest) (requires build)
Starting     doctest-0.22.9 (lib)
Building     doctest-0.22.9 (lib)
Installing   doctest-0.22.9 (lib)
Completed    doctest-0.22.9 (lib)
Starting     doctest-0.22.9 (exe:doctest)
Building     doctest-0.22.9 (exe:doctest)
Installing   doctest-0.22.9 (exe:doctest)
Completed    doctest-0.22.9 (exe:doctest)
Copying 'doctest' to
'/home/runner/.cabal/doctest/ghc-9.8.2-6fbce3708d1cdaa02b114e8244ac58f9/doctest-0.22.9'
doctest version 0.22.9
using version 9.8.2 of the GHC API
using /usr/local/.ghcup/ghc/9.8.2/bin/ghc-9.8.2
Resolving dependencies...
Build profile: -w ghc-9.8.2 -O1
In order, the following will be built (use -v for more details):
 - haskus-utils-data-1.4 (interactive) (lib) (configuration changed)
 - haskus-utils-data-1.4 (interactive) (test:tests) (configuration changed)
Configuring library for haskus-utils-data-1.4...
Configuring test suite 'tests' for haskus-utils-data-1.4...
Preprocessing test suite 'tests' for haskus-utils-data-1.4...
Preprocessing library for haskus-utils-data-1.4...
GHCi, version 9.8.2: https://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /home/runner/.cabal/doctest/ghc-9.8.2-6fbce3708d1cdaa02b114e8244ac58f9/init-ghci-0.22.9
[ 1 of 12] Compiling Haskus.Utils.Either[haskus-utils-data-1.4-inplace]
[ 2 of 12] Compiling Haskus.Utils.Functor[haskus-utils-data-1.4-inplace]
[ 3 of 12] Compiling Haskus.Utils.InfList[haskus-utils-data-1.4-inplace]
[ 4 of 12] Compiling Haskus.Utils.List[haskus-utils-data-1.4-inplace]
[ 5 of 12] Compiling Haskus.Utils.Map[haskus-utils-data-1.4-inplace]
[ 6 of 12] Compiling Haskus.Utils.Map.Strict[haskus-utils-data-1.4-inplace]
[ 7 of 12] Compiling Haskus.Utils.Maybe[haskus-utils-data-1.4-inplace]
[ 8 of 12] Compiling Haskus.Utils.Monad[haskus-utils-data-1.4-inplace]
[ 9 of 12] Compiling Haskus.Utils.Tuple[haskus-utils-data-1.4-inplace]
[10 of 12] Compiling Haskus.Utils.HList[haskus-utils-data-1.4-inplace]
[11 of 12] Compiling Main[haskus-utils-data-1.4-inplace-tests]
Ok, 11 modules loaded.
ghci> Leaving GHCi.
Examples: 0  Tried: 0  Errors: 0  Failures: 0

Similarly, when I try cabal doctest all it requires multi-repl: True but if enabled it just drops me into a repl with all the modules loaded.

@sol
Copy link
Owner Author

sol commented Aug 1, 2024

@hsyl20 does passing --disable-multi-repl to cabal doctest on the command line work as a workaround?

@hsyl20
Copy link
Contributor

hsyl20 commented Aug 5, 2024

@sol Yes it does

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants