haskell/cabal — pull request #995 by ttuegel (2012-08-09 16:37:08+00:00)
Title: Automatically configure and build before 'cabal test' and 'cabal bench'

Issue: https://github.com/haskell/cabal/issues/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.