MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
simple.t.c

This is an simple example of how to write a test using the library. The output of this program is:

1..1
# Testing basic functions
ok 1 - Testing gcs()

The basic structure is: plan the number of test points using the plan() function, perform the test and write out the result of each test point using the ok() function, print out a diagnostics message using diag(), and report the result of the test by calling the exit_status() function. Observe that this test does excessive testing (see Writing unnecessarily large tests), but the test point doesn't take very long time.