|
1 | 1 | <!--
|
2 |
| -$PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.108 2005/11/17 22:14:50 tgl Exp $ |
| 2 | +$PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.109 2005/11/29 01:46:54 alvherre Exp $ |
3 | 3 | -->
|
4 | 4 |
|
5 | 5 | <sect1 id="xfunc">
|
@@ -2106,7 +2106,7 @@ include $(PGXS)
|
2106 | 2106 | <term><varname>REGRESS</varname></term>
|
2107 | 2107 | <listitem>
|
2108 | 2108 | <para>
|
2109 |
| - list of regression test cases (without suffix) |
| 2109 | + list of regression test cases (without suffix), see below |
2110 | 2110 | </para>
|
2111 | 2111 | </listitem>
|
2112 | 2112 | </varlistentry>
|
@@ -2186,6 +2186,36 @@ include $(PGXS)
|
2186 | 2186 | corresponds to the first <command>pg_config</command> command
|
2187 | 2187 | found in your path.
|
2188 | 2188 | </para>
|
| 2189 | + |
| 2190 | + <para> |
| 2191 | + The scripts listed in the <varname>REGRESS</> variable are used for |
| 2192 | + regression testing of your module, just like <literal>make |
| 2193 | + installcheck</literal> is used for the main |
| 2194 | + <productname>PostgreSQL</productname> server. For this to work you need |
| 2195 | + to have a subdirectory named <literal>sql/</literal> in your extension's |
| 2196 | + directory, within which you put one file for each group of tests you want |
| 2197 | + to run. The files should have extension <literal>.sql</literal>, which |
| 2198 | + should not be included in the <varname>REGRESS</varname> list in the |
| 2199 | + makefile. For each test there should be a file containing the expected |
| 2200 | + result in a subdirectory named <literal>expected/</literal>, with extension |
| 2201 | + <literal>.out</literal>. The tests are run by executing <literal>make |
| 2202 | + installcheck</literal>, and the resulting output will be compared to the |
| 2203 | + expected files. The differences will be written to the file |
| 2204 | + <literal>regression.diffs</literal> in <command>diff -c</command> format. |
| 2205 | + Note that trying to run a test which is missing the expected file will be |
| 2206 | + reported as <quote>trouble</quote>, so make sure you have all expected |
| 2207 | + files. |
| 2208 | + </para> |
| 2209 | + |
| 2210 | + <tip> |
| 2211 | + <para> |
| 2212 | + The easiest way of creating the expected files is creating empty files, |
| 2213 | + then carefully inspecting the result files after a test run (to be found |
| 2214 | + in the <literal>results/</literal> directory), and copying them to |
| 2215 | + <literal>expected/</literal> if they match what you want from the test. |
| 2216 | + </para> |
| 2217 | + |
| 2218 | + </tip> |
2189 | 2219 | </sect2>
|
2190 | 2220 |
|
2191 | 2221 |
|
|
0 commit comments