[qmtest] Pass context variables between test classes

Mark Mitchell mark at codesourcery.com
Thu Nov 13 16:34:05 UTC 2003


On Thu, 2003-11-13 at 07:59, Anders Hasselqvist wrote:
> Hi,
> 
> I have a structure in my test suite like this:
> Test.blabla.1
> Test.blabla.2
> 
> Class 2 depends on 1 and need some info created there.

QMTest is designed to make that hard for you to do.

That was a conscious and intentional decision.

Each test should be independent of other tests.  That is the only way
that you can get good reproducibility in your testsuite over time, and
it is the only way that tests can be run in parallel.

You can cheat, by (for example), having the first test write files into
the filesystem which the second test reads, but that's not encouraged.

Generally, the right solution is to factor the bits common to test 1 and
test 2 into a "resource", and have both tests depend on the resource. 
The context variables created by a resource are visible to its dependent
tests.

-- 
Mark Mitchell <mark at codesourcery.com>
CodeSourcery, LLC




More information about the qmtest mailing list