From 19fecee06ea7dfca94f60663be2d52a30b898f37 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 29 Nov 2005 01:46:54 +0000 Subject: [PATCH] Document PGXS' REGRESS feature. --- doc/src/sgml/xfunc.sgml | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml index e5dfe9d48c..f9840bd466 100644 --- a/doc/src/sgml/xfunc.sgml +++ b/doc/src/sgml/xfunc.sgml @@ -1,5 +1,5 @@ @@ -2106,7 +2106,7 @@ include $(PGXS) REGRESS - list of regression test cases (without suffix) + list of regression test cases (without suffix), see below @@ -2186,6 +2186,36 @@ include $(PGXS) corresponds to the first pg_config command found in your path. + + + The scripts listed in the REGRESS variable are used for + regression testing of your module, just like make + installcheck is used for the main + PostgreSQL server. For this to work you need + to have a subdirectory named sql/ in your extension's + directory, within which you put one file for each group of tests you want + to run. The files should have extension .sql, which + should not be included in the REGRESS list in the + makefile. For each test there should be a file containing the expected + result in a subdirectory named expected/, with extension + .out. The tests are run by executing make + installcheck, and the resulting output will be compared to the + expected files. The differences will be written to the file + regression.diffs in diff -c format. + Note that trying to run a test which is missing the expected file will be + reported as trouble, so make sure you have all expected + files. + + + + + The easiest way of creating the expected files is creating empty files, + then carefully inspecting the result files after a test run (to be found + in the results/ directory), and copying them to + expected/ if they match what you want from the test. + + + -- 2.11.0