[qmtest] how to set up resources for tests
Mark Mitchell
mark at codesourcery.com
Mon Aug 16 16:42:30 UTC 2004
Stefan Seefeld wrote:
> Hi Mark,
>
> Mark Mitchell wrote:
>
>> A resource is definitely what you want here. The documentation is a
>> bit lacking, but a resource class is very much like a test class.
>> The temporary.TempDirectoryResource class that comes with QMTest is a
>> good example of a resource class.
>
>
> That's good to know, thanks. Subclassing a Resource to compile me
> test applet looks simple enough. My question was more aimed at how
> to declare (to the database / test classes) this resource as a
> dependency. (I'm using my own database / test classes, so I'd like
> to know the API, not any GUI / xml way to do it).
The TestDescriptor returned by your Database.GetTest method should have
an argument called "resources" that is a sequence of resource names,
like [ "foo.bar", "baz" ].
You can look at XMLDatabase.__ParseTestDocument to see how that works;
look at where it sets up arguments["resources"].
Let me know if I still didn't answer the question! :-)
--
Mark Mitchell
CodeSourcery, LLC
mark at codesourcery.com
More information about the qmtest
mailing list