1
by brian
clean slate |
1 |
This directory contains a test suite for the MySQL daemon. To run |
2 |
the currently existing test cases, simply execute ./mysql-test-run in |
|
3 |
this directory. It will fire up the newly built mysqld and test it. |
|
4 |
||
5 |
Note that you do not have to have to do "make install", and you could |
|
6 |
actually have a co-existing MySQL installation. The tests will not |
|
7 |
conflict with it. |
|
8 |
||
9 |
All tests must pass. If one or more of them fail on your system, please |
|
10 |
read the following manual section for instructions on how to report the |
|
11 |
problem: |
|
12 |
||
13 |
http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html |
|
14 |
||
15 |
If you want to use an already running MySQL server for specific tests, |
|
16 |
use the --extern option to mysql-test-run. Please note that in this mode, |
|
17 |
the test suite expects you to provide the names of the tests to run. |
|
18 |
For example, here is the command to run the "alias" and "analyze" tests |
|
19 |
with an external server: |
|
20 |
||
21 |
mysql-test-run --extern alias analyze |
|
22 |
||
23 |
To match your setup, you might also need to provide --socket, --user, and |
|
24 |
other relevant options. |
|
25 |
||
26 |
With no test cases named on the command line, mysql-test-run falls back |
|
27 |
to the normal "non-extern" behavior. The reason for this is that some |
|
28 |
tests cannot run with an external server. |
|
29 |
||
30 |
||
31 |
You can create your own test cases. To create a test case, create a new |
|
32 |
file in the t subdirectory using a text editor. The file should have a .test |
|
33 |
extension. For example: |
|
34 |
||
35 |
xemacs t/test_case_name.test |
|
36 |
||
37 |
In the file, put a set of SQL statements that create some tables, |
|
38 |
load test data, and run some queries to manipulate it. |
|
39 |
||
40 |
We would appreciate it if you name your test tables t1, t2, t3 ... (to not |
|
41 |
conflict too much with existing tables). |
|
42 |
||
43 |
Your test should begin by dropping the tables you are going to create and |
|
44 |
end by dropping them again. This ensures that you can run the test over |
|
45 |
and over again. |
|
46 |
||
47 |
If you are using mysqltest commands (like result file names) in your |
|
48 |
test case, you should create the result file as follows: |
|
49 |
||
50 |
mysql-test-run --record test_case_name |
|
51 |
||
52 |
or
|
|
53 |
||
54 |
mysqltest --record < t/test_case_name.test |
|
55 |
||
56 |
If you only have a simple test cases consisting of SQL statements and |
|
57 |
comments, you can create the test case in one of the following ways: |
|
58 |
||
59 |
mysql-test-run --record test_case_name |
|
60 |
||
61 |
mysql test < t/test_case_name.test > r/test_case_name.result |
|
62 |
||
63 |
mysqltest --record --record-file=r/test_case_name.result < t/test_case_name.test |
|
64 |
||
65 |
When this is done, take a look at r/test_case_name.result |
|
66 |
- If the result is incorrect, you have found a bug. In this case, you should |
|
67 |
edit the test result to the correct results so that we can verify |
|
68 |
that the bug is corrected in future releases. |
|
69 |
||
70 |
To submit your test case, put your .test file and .result file(s) into |
|
71 |
a tar.gz archive, add a README that explains the problem, ftp the |
|
72 |
archive to ftp://support.mysql.com/pub/mysql/secret/ and send a mail |
|
73 |
to bugs@lists.mysql.com |