-
Notifications
You must be signed in to change notification settings - Fork 710
Automatically configure and build before 'cabal test' and 'cabal bench' #995
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
Conversation
Could you please rebase your commits so you don't have those revert commits and the merge commit? That would make it easier to review the changes. If I understood your explanation of the UI changes correctly, cabal test and cabal bench now accept the same flags as cabal install. Do all the flags from cabal install make sense even if we're not installing dependencies? Long term we will most likely install dependencies and this becomes a moot point, but in the meantime I'd like to not confuse users by presenting them with flags that in fact have no effect. |
How difficult would it be to apply the same change to |
The test and benchmark cabal-install commands now accept ConfigFlags and ConfigExFlags in the same way as the install command, so that the package can be configured before running test suites or benchmarks. Also like the install command, the test and bench commands run the build command with the default options to perform any necessary rebuilds.
That's what I meant - changing |
From the code, I see that |
@tibbe Thanks for recommending the rebase. I'm still learning git, and my brain has been stuck in darcs-mode recently :) As @23Skidoo pointed out, the test and bench commands don't accept Haddock flags, but they accept the other (extra) flags that install does, i.e., they do not accept any |
|
Here's what I think:
|
I chatted a bit with @dcoutts on IRC today. We don't need to be worried about distros as long as we're not touching If you want you can prepare a patch that does what your current patch does minus passing configure flags from test/bench to configure (i.e. configure would reuse the flags from the last configure run) and I can apply it right now. We can separate the configure flags issue into a separate issue and make some progress that way. |
Issue: #585
I can merge this pull request myself, but I wanted to solicit feedback from interested parties first (especially because of the command line UI change).
This patch changes the behaviour of the test and bench commands in cabal-install so that the package in the current directory is configured and built before attempting to run the test suites or benchmarks. The net result is that running 'cabal unpack foo; cd foo; cabal test' does what you mean, rather than ordering you to run 'cabal configure' first. Happily, this also solves the problem where a developer's changes were not being detected in the test suite because the affected files had not been rebuilt.
This is accompanied by a user interface change: the test and bench commands now accept ConfigFlags and ConfigExFlags in the same way the install command does. I think the test and bench commands should reflect the install command because they now do mostly the same things. Also, if we plan to have the test and bench commands eventually pull in the necessary dependencies, there will really be no way around this UI change.