mtr Writing Test Cases

Table of Contents

  • Writing a Test Case: Quick Start
  • Test Case Coding Guidelines
  • Sample Test Case
  • Cleaning Up from a Previous Test Run
  • Generating a Test Case Result File
  • Checking for Expected Errors
  • Controlling the Information Produced by a Test - Case
  • Dealing with Output That Varies Per Test Run
  • Passing Options from to - mysqld or mysqltest
  • Specifying Test Case-Specific Server Options
  • Specifying Test Case-Specific Bootstrap Options
  • Specifying Test Case-Specific Client Options
  • Using Include Files to Simplify Test Cases
  • Controlling the Binary Log Format Used for - Tests
  • Writing Replication Tests
  • Thread Synchronization in Test Cases
  • Suppressing Errors and Warning
  • Stopping and Restarting a Server During a Test
  • Other Tips for Writing Test Cases

Normally, you run the test suite during the development process to ensure that your changes do not cause existing test cases to break. You can also write new test cases or add tests to existing cases. This happens when you fix a bug (so that the bug cannot reappear later without being detected) or when you add new capabilities to the server or other MySQL programs.

This chapter provides guidelines for developing new test cases for the MySQL test framework.

Some definitions:

  • One “test file” is one “test case”.
  • One “test case” might contain a “test sequence” (that is, a number of individual tests that are grouped together in the same test file).
  • A “command” is an input test that mysqltest recognizes and executes itself. A “statement” is an SQL statement or query that mysqltest sends to the MySQL server to be executed.