[qmtest] syntax for creating targets?
Mark Mitchell
mark at codesourcery.com
Thu Nov 20 02:50:38 UTC 2003
On Wed, 2003-11-19 at 10:05, Steve Byan wrote:
> On Nov 19, 2003, at 12:41 PM, Steve Byan wrote:
>
> > I'm trying to create a target using one of the started target classes,
> > e,g, SerialTarget. I'm getting the following error from qmtest 2.0.3:
> >
> > [smb at edvac tdb]$ qmtest create-target minigolf SerialTarget BladeFrame
> > qmtest: error: The extension class 'SerialTarget' could not be found.
> > You may
> > need to set the 'QMTEST_CLASS_PATH' environment
> > variable.
>
> I found the hint I needed in the "classes.qmc" file in the
> /usr/local/qm/qm/test/classes directory; the class name to use is
> "serial_target.SerialTarget". Perhaps adding an example in section
> 3.4.2 of the doc's would help others in the future.
I agree.
Here's the patch I checked in.
--
Mark Mitchell <mark at codesourcery.com>
CodeSourcery, LLC
-------------- next part --------------
2003-11-19 Mark Mitchell <mark at codesourcery.com>
* qm/test/doc/reference.xml: Improve documentation for "qmtest
create".
Index: qm/test/doc/reference.xml
===================================================================
RCS file: /home/sc/Repository/qm/qm/test/doc/reference.xml,v
retrieving revision 1.34
diff -c -5 -p -r1.34 reference.xml
*** qm/test/doc/reference.xml 14 Oct 2003 21:56:07 -0000 1.34
--- qm/test/doc/reference.xml 20 Nov 2003 02:44:10 -0000
***************
*** 628,667 ****
<command>&qmtest-cmd; create</command>
<arg choice="opt" rep="repeat">
<replaceable>option</replaceable>
</arg>
<arg choice="plain">
<replaceable>descriptor</replaceable>
</arg>
</cmdsynopsis>
</section>
<section>
<title>Description</title>
<para>The <command>&qmtest-cmd; create</command> creates a new
extension instance. For example, this command can be used to
! create a new test or resource. For a list of the types of
extensions supported by &qmtest;, run <command>&qmtest-cmd;
! extensions</command>.</para>
<para>The descriptor specifies an extension class and (optionally)
attributes for that extension class. The form of the descriptor is
<command><replaceable>class</replaceable>(<replaceable>attributes</replaceable>)</command>,
where the attributes are of the form
<command><replaceable>attr</replaceable> =
"<replaceable>val</replaceable>"</command>. If there
are no attributes, the parentheses may be omitted.</para>
! <para>If the <replaceable>class</replaceable> names a extension
! file (such as an existing test or resource file), that file is
! read. The extension class used is the one specified in that
! file. Any attributes specified in the file are also read.</para>
!
! <para>Any attributes specified in the descriptor (including those
! in the extension file, if <replaceable>class</replaceable>
! indicates an extension file) override those provided on the
! command line using the <option>&dashdash;attribute</option> option.</para>
<para>The new extension file is written to the file specified with
the <option>&dashdash;output</option> option, or to the standard
output if no <option>&dashdash;output</option> is specified.</para>
--- 628,681 ----
<command>&qmtest-cmd; create</command>
<arg choice="opt" rep="repeat">
<replaceable>option</replaceable>
</arg>
<arg choice="plain">
+ <replaceable>kind</replaceable>
+ </arg>
+ <arg choice="plain">
<replaceable>descriptor</replaceable>
</arg>
</cmdsynopsis>
</section>
<section>
<title>Description</title>
<para>The <command>&qmtest-cmd; create</command> creates a new
extension instance. For example, this command can be used to
! create a new test or resource. For a list of the kinds of
extensions supported by &qmtest;, run <command>&qmtest-cmd;
! extensions</command>. The <replaceable>kind</replaceable>
! must be one of these extension kinds.</para>
<para>The descriptor specifies an extension class and (optionally)
attributes for that extension class. The form of the descriptor is
<command><replaceable>class</replaceable>(<replaceable>attributes</replaceable>)</command>,
where the attributes are of the form
<command><replaceable>attr</replaceable> =
"<replaceable>val</replaceable>"</command>. If there
are no attributes, the parentheses may be omitted.</para>
! <para>The <replaceable>class</replaceable> may be either the path
! to an extension file or a QMTest class name in the form
! <replaceable>module.class</replaceable>. If the
! <replaceable>class</replaceable> is the path to an extension file
! (such as an existing test or resource file), the class name used
! is the one provided in the file; otherwise the class named used is
! the name provided on the command line.</para>
!
! <para>The attributes used to construct the extension instance come
! from three sources: the attributes in the extension file (if the
! <replaceable>class</replaceable> is the path to an extension
! file), the <option>&dashdash;attribute</option> options provided
! on the command line, and the explicit attributes provided in the
! descriptor. If multiple values for the the same attribute name
! are provided, the value used is taken from the first source in the
! following list for which there is a value: the rightmost attribute
! provided in the descriptor, the extension file, or the rightmost
! <option>&dashdash;attribute</option> present on the command
! line.</para>
<para>The new extension file is written to the file specified with
the <option>&dashdash;output</option> option, or to the standard
output if no <option>&dashdash;output</option> is specified.</para>
***************
*** 693,704 ****
--- 707,731 ----
<para>Write a description of the extension instance to
<replaceable>file</replaceable>.</para>
</listitem>
</varlistentry>
</variablelist>
+ </section>
+ <section>
+ <title>Example</title>
+
+ <para>
+ This command:
+ <screen><userinput><![CDATA[
+ qmtest create -a format=stats -o rs
+ result_stream text_result_stream.TextResultStream(filename="rs")]]></userinput></screen>
+ creates a file called <filename>rs</filename> containing an
+ instance of <classname>TextResultStream</classname>.
+ </para>
</section>
+
</section>
<section id="sec-testcmd-create-target">
<title><command>&qmtest-cmd; create-target</command></title>
More information about the qmtest
mailing list