From e59f8174d5d006e78e474873ca4ba89a4e5c21d2 Mon Sep 17 00:00:00 2001 From: Jelte Fennema Date: Thu, 13 Jan 2022 15:26:35 +0100 Subject: [PATCH 2/2] Add documentation for libpq_pipeline tests This adds some explanation on how to run and add libpq tests. --- src/test/modules/libpq_pipeline/README | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/test/modules/libpq_pipeline/README b/src/test/modules/libpq_pipeline/README index d8174dd579..3eac0bf131 100644 --- a/src/test/modules/libpq_pipeline/README +++ b/src/test/modules/libpq_pipeline/README @@ -1 +1,21 @@ Test programs and libraries for libpq +===================================== + +You can manually run a specific test by running: + + ./libpq_pipeline + +You can add new tests to libpq_pipeline.c to adding a new test for libpq you +should add your new test you should add the name of your new test to the +"print_test_list" function. Then in main you should do something when this test +name is passed to the program. + +If the order in which postgres protocol messages are sent is deterministic for +your test. Then you can generate a trace of these messages using the following +command: + + ./libpq_pipeline mynewtest -t traces/mynewtest.trace + +Once you've done that you should make sure that when running "make check" +the generated trace is compared to the expected trace. This is done by adding +your test name to the $cmptrace definition in the t/001_libpq_pipeline.pl file -- 2.17.1