[qmtest] writing composite tests
Mark Mitchell
mark at codesourcery.com
Mon Sep 8 19:56:28 UTC 2003
On Mon, 2003-09-08 at 11:59, Stefan Seefeld wrote:
> Mark Mitchell wrote:
>
> > But, why do you have to change the Run interface? The Run method in the
> > composite class could simply pass its result parameter down to the
> > contained test classes. Wouldn't that work?
>
> yes, sure. Then I'd write
>
> def Run(self, context, result):
> self.a.Run(context, result)
>
> if result.GetOutcome() == result.FAIL:
> return
>
> self.b.Run(context, result)
>
>
> which is a bit more verbose than just
>
> def Run(self, context, result):
> return self.a.Run(context, result) and self.b.Run(context, result)
The flip side is that to make your way work, every Run method has to
remember to return a value. When we designed the interface, we thought
it would be more reliable to avoid having to return the value.
It's possible that some magic could be implemented so that the user's
Run method doesn't have to return the value, but then the caller gets a
value anyhow, but we didn't want to try that. :-)
--
Mark Mitchell <mark at codesourcery.com>
CodeSourcery, LLC
More information about the qmtest
mailing list