You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.8 KiB

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