[qmtest] making QMtest grep the Standard Output

Stefan Seefeld stefan at codesourcery.com
Thu Jun 8 15:35:36 UTC 2006


Sean Kelly wrote:
> I have a program/script that returns a time stamp in its output.  So the
> Standard Output I put in my test case will never match the actual output.
> Also the output ordering of the strings from the program can sometimes be
> different.
> 
> Is there any way to specify in the Standard output that only certain strings
> are contained in the actual output?

Not per se. However, the command.ExecTestBase class defines a ValidateOutput()
method for this purpose. The default implementation simply compares the text
with the expected values for stdout and stderr.
You may be able to subclass from that (or any of its existing subclasses),
providing your own ValidateOutput() method that ignores the irrelevant parts
of the output.

Regards,
		Stefan

-- 
Stefan Seefeld
CodeSourcery
stefan at codesourcery.com
(650) 331-3385 x718



More information about the qmtest mailing list