|
1 | 1 | Test programs and libraries for libpq
|
| 2 | +===================================== |
| 3 | + |
| 4 | +This module was developed to test libpq's "pipeline" mode, but it can |
| 5 | +be used for any libpq test that requires specialized C code. |
| 6 | + |
| 7 | +"make check" will run all the tests in the module against a temporary |
| 8 | +server installation. |
| 9 | + |
| 10 | +You can manually run a specific test by running: |
| 11 | + |
| 12 | + ./libpq_pipeline <name of test> [ <connection string> ] |
| 13 | + |
| 14 | +This will not start a new server, but rather connect to the server |
| 15 | +specified by the connection string, or your default server if you |
| 16 | +leave that out. To discover the available test names, run: |
| 17 | + |
| 18 | + ./libpq_pipeline tests |
| 19 | + |
| 20 | +To add a new test to this module, you need to edit libpq_pipeline.c. |
| 21 | +Add a function to perform the test, and arrange for main() to call it |
| 22 | +when the name of your new test is passed to the program. Don't forget |
| 23 | +to add the name of your test to the print_test_list() function, else |
| 24 | +the TAP test won't run it. |
| 25 | + |
| 26 | +If the order in which Postgres protocol messages are sent is deterministic |
| 27 | +in your test, you should arrange for the message sequence to be verified |
| 28 | +by the TAP test. First generate a reference trace file, using a command |
| 29 | +like: |
| 30 | + |
| 31 | + ./libpq_pipeline -t traces/mynewtest.trace mynewtest |
| 32 | + |
| 33 | +Then add your test's name to the list in the $cmptrace definition in the |
| 34 | +t/001_libpq_pipeline.pl file. Run "make check" a few times to verify |
| 35 | +that the trace output actually is stable. |
0 commit comments