Author: paul
Date: 2008-09-02 17:35:54 +0200 (Tue, 02 Sep 2008)
New Revision: 11638
Log:
r33567@frost: paul | 2008-09-02 10:34:43 -0500
mysqltest manual: general revisions
Modified:
trunk/mysqltest/command-reference.xml
trunk/mysqltest/writing-tests.xml
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:35828
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:33558
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:32819
+ 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:35828
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:33567
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:32819
Modified: trunk/mysqltest/command-reference.xml
===================================================================
--- trunk/mysqltest/command-reference.xml 2008-09-02 15:09:43 UTC (rev 11637)
+++ trunk/mysqltest/command-reference.xml 2008-09-02 15:35:54 UTC (rev 11638)
Changed blocks: 8, Lines Added: 14, Lines Deleted: 14; 1673 bytes
@@ -208,7 +208,7 @@
</para>
<programlisting>
-let $a = This is a variable
+let $a= This is a variable
# assignment that sets a variable
-- to a multiple-line value;
</programlisting>
@@ -1339,7 +1339,7 @@
</para>
<programlisting>
-let $counter=0;
+let $counter= 0;
if ($counter)
{
echo Counter is greater than 0, (counter=0);
@@ -1402,8 +1402,8 @@
</para>
<programlisting>
---let $1 = 0
-let $count = 10;
+--let $1= 0
+let $count= 10;
</programlisting>
<para>
@@ -1413,7 +1413,7 @@
</para>
<programlisting>
-let $q = `SELECT VERSION()`;
+let $q= `SELECT VERSION()`;
</programlisting>
<remark role="todo">
@@ -1430,8 +1430,8 @@
</para>
<programlisting>
-let $mysqltest_variable = foo;
-let ENV_VARIABLE = bar;
+let $mysqltest_variable= foo;
+let ENV_VARIABLE= bar;
</programlisting>
<para>
@@ -2221,8 +2221,8 @@
</para>
<programlisting>
-let $dir = /tmp;
-let $file = junk;
+let $dir= /tmp;
+let $file= junk;
source $dir/$file;
</programlisting>
</listitem>
@@ -2462,10 +2462,10 @@
</para>
<programlisting>
-let $a = 14;
-let $b = this is a string;
---let $a = 14
---let $b = this is a string
+let $a= 14;
+let $b= this is a string;
+--let $a= 14
+--let $b= this is a string
</programlisting>
<para>
@@ -2498,7 +2498,7 @@
</para>
<programlisting>
-let $q = `select version()`;
+let $q= `select version()`;
</programlisting>
<para>
Modified: trunk/mysqltest/writing-tests.xml
===================================================================
--- trunk/mysqltest/writing-tests.xml 2008-09-02 15:09:43 UTC (rev 11637)
+++ trunk/mysqltest/writing-tests.xml 2008-09-02 15:35:54 UTC (rev 11638)
Changed blocks: 10, Lines Added: 55, Lines Deleted: 11; 5513 bytes
@@ -1435,11 +1435,38 @@
</para>
</listitem>
+ <listitem>
+ <para>
+ Debugging capabilities: Include the
+ <literal>have_debug.inc</literal> file if a test requires
+ that the server was built for debugging (that is, that the
+ MySQL distribution was configured with the
+ <option>--with-debug</option> option).
+ </para>
+ </listitem>
+
</itemizedlist>
</listitem>
<listitem>
<para>
+ Wait for a condition to become true. Set the
+ <literal>$wait_condition</literal> variable to a SQL statement
+ that selects a value and then include the
+ <literal>wait_condition.inc</literal> file. The include file
+ executes the statement in a loop with a 0.1 second sleep
+ between executions until the select value is non-zero. For
+ example:
+ </para>
+
+<programlisting>
+let $wait_condition= SELECT c = 3 FROM t;
+--source include/wait_condition.inc
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
Control the binary log format. See
<xref linkend="writing-tests-binlog-control"/>.
</para>
@@ -1454,6 +1481,21 @@
</itemizedlist>
+ <indexterm>
+ <primary>include files</primary>
+ <secondary>as subroutines</secondary>
+ </indexterm>
+
+ <para>
+ You can think of an include file as a rudimentary form of
+ subroutine that is <quote>called</quote> at the point of
+ inclusion. You can <quote>pass parameters</quote> by setting
+ variables before including the file and referring to them within
+ the file. You can <quote>return</quote> values by setting
+ variables within the file and referring them following inclusion
+ of the file.
+ </para>
+
</section>
<section id="writing-tests-binlog-control">
@@ -1471,9 +1513,7 @@
that produce data changes. As of MySQL 5.1, the server also
supports row-based logging (RBL), which logs events as changes to
individual rows. It also supports mixed logging, which switches
- between SBL and RBL automatically as necessary. Some tests require
- the use of a particular binary log format. This section describes
- how to control the format for testing purposes.
+ between SBL and RBL automatically as necessary.
</para>
<para>
@@ -1493,7 +1533,9 @@
</programlisting>
<para>
- For tests, you can exercise control over the binary log format in
+Some tests require
+ of a particular binary log format.
+ You can exercise control over the binary log format in
two ways:
</para>
@@ -1577,8 +1619,8 @@
As an alternative to using the <option>--combination</option>
option, you can create a file named
<filename>combinations</filename> in the test suite directory
- and list the arguments that you would specify via
- <option>--combination</option>, one line per argument. For the
+ and list the options that you would specify via
+ <option>--combination</option>, one line per option. For the
preceding <command>mysql-test-run.pl</command> command, the
suite name is <literal>rpl</literal>, so you would create a file
named <filename>suite/rpt/combinations</filename> with these
@@ -1608,6 +1650,8 @@
in the <filename>combinations</filename> file should include the
leading dashes. (Options in <filename>my.cnf</filename> files
are given without the leading dashes.)
+<command>mysql-test-run.pl</command> displays the section name following
+the test name when it reports the test result.
</para>
<para>
@@ -1649,7 +1693,7 @@
</programlisting>
<para>
- The following files can be used for tests that support two log
+ The following files can be used for tests that support two binary log
formats:
</para>
@@ -1708,13 +1752,13 @@
<para>
If you need to do something on an alternative connection, you can
- use <literal>connection master1;</literal> for the master, and
+ use <literal>connection master1;</literal> for the master and
<literal>connection slave1;</literal> for the slave.
</para>
<para>
To run the master with additional options for your test case, put
- them in the command-line format in
+ them in command-line format in
<filename>t/<replaceable>test_name</replaceable>-master.opt</filename>.
When a file named
<filename>t/<replaceable>test_name</replaceable>-master.opt</filename>
@@ -1916,7 +1960,7 @@
</para>
<programlisting>
-let $1=1000;
+let $1= 1000;
while ($1)
{
# execute your statements here
@@ -1989,7 +2033,7 @@
for filesystem operations. This used to be very common, but OS
commands tend to be platform specific, which reduces test
portability. <command>mysqltest</command> now has several
- commands to perform these operations portably, so they should
+ commands to perform these operations portably, so these commands should
be used instead: <literal>remove_file</literal>,
<literal>chmod_file</literal>, <literal>mkdir</literal>, and
so forth.
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r11638 - in trunk: . mysqltest | paul.dubois | 2 Sep |