Documentation Home
The MySQL Test Framework, Version 1.0
Download this Manual
PDF (US Ltr) - 443.9Kb
PDF (A4) - 445.6Kb

The MySQL Test Framework, Version 1.0  /  ...  /  File Naming and Organization Guidelines

4.2.1 File Naming and Organization Guidelines

Test case file names should be lowercase ASCII with no spaces.

We are adding support for multiple test suites. Until then, all test cases must be located in the mysql-test/t directory. Test case file names consist of the test name with a .test suffix. For example, a test named foo should be written in the file mysql-test/t/foo.test.

One test case file can be a collection of individual tests that belong together. If one of the tests fails, the entire test case fails. Although it may be tempting to write each small test into a single file, that will be too inefficient and makes test runs unbearably slow. So make the test case files not too big, not too small.

Each test case (that is, each test file) must be self contained and independent of other test cases. Do not create or populate a table in one test case and depend on the table in a later test case. If you have some common initialization that needs to be done for multiple test cases, create an include file. That is, create a file containing the initialization code in the mysq-test/include directory, and then put a source command in each test case that requires the code. For example, if several test cases need to have a given table created and filled with data, put the statements to do that in a file named mysql-test/include/ Then put the following command in each test case file that needs the initialization code:

--source include/

The file name in the source command is relative to the mysql-test directory.