New test-suite functionality

Duncan Coutts duncan.coutts at googlemail.com
Mon Jan 10 14:34:56 CET 2011


On Fri, 2011-01-07 at 12:02 -0600, Thomas Tuegel wrote:

> I actually tried to set out doing this today and realized it's not a
> good idea to do it this way.  I think it would be better to add a
> field such as "testEnabled :: Bool" to the TestSuite object.  This has
> several advantages:
> 1. We can distinguish between packages configured with tests disabled
> and packages without test suites.
> 2. Users could selectively enable and disable particular tests, which
> is good from a dependency standpoint.
> 3. During dependency resolution, we can actually tell if a test is
> enabled or disabled, i.e., we don't have to cut out all the test
> suites before resolution.  (This would fix several of the TODO's that
> you've indicated in Distribution.Simple.Configure.)
> 
> This would be a little bit more involved than my previous, naive
> suggestion, but I think it's worth it.  Let me know if you agree; I
> just don't want to waste your time by submitting a misguided patch.

I'm slightly reticent to add it to the TestSuite bit itself because it's
mixing two things: a static description of the package, with status
tracking within the build system.

That said, there's not an obvious place to put it that exists all the
way through the dep resolution stage. If it were just later on then we
could add something to the LocalBuildInfo.

Give it a go, but add a TODO note suggesting the status info might be
better to live somewhere else. We might be able to do it better when we
next overhaul the GenericPackageDescription -> PackageDescription
resolution stuff.

Duncan




More information about the cabal-devel mailing list