@@ -9,17 +9,15 @@ Regression test instructions and analysis.
99
1010<Para>
1111 The PostgreSQL regression tests are a comprehensive set of tests for the
12- SQL implementation embedded in PostgreSQL developed by Jolly Chen and
13- Andrew Yu. It tests standard SQL operations as well as the extended
14- capabilities of PostgreSQL.
12+ SQL implementation embedded in PostgreSQL. They test standard SQL
13+ operations as well as the extended capabilities of PostgreSQL.
1514</Para>
1615
1716<Para>
18- These tests have recently been revised by Marc Fournier and Thomas Lockhart
19- and are now packaged as
20- functional units which should make them easier to run and easier to interpret.
21- From <ProductName>PostgreSQL</ProductName> v6.1 onward
22- the regression tests are current for every official release.
17+ The regression tests were originally developed by Jolly Chen and Andrew Yu,
18+ and were extensively revised/repackaged by Marc Fournier and Thomas Lockhart.
19+ From <ProductName>PostgreSQL</ProductName> v6.1 onward
20+ the regression tests are current for every official release.
2321</Para>
2422
2523<Para>
@@ -66,19 +64,18 @@ The runtime path is /usr/local/pgsql (other paths are possible).
6664<Title>Regression Environment</Title>
6765
6866<Para>
69- The regression test is invoked by the <Command>make</Command> command which compiles
70- a <Acronym>C</Acronym> program into a shared library
71- in the current directory. Localized shell scripts are also created in
72- the current directory. The output file templates are massaged into the
73- <FileName>./expected/*.out</FileName> files. The localization replaces macros in the source
74- files with absolute pathnames and user names.
67+ To prepare for regression testing, do <Command>make all</Command> in the regression test
68+ directory. This compiles a <Acronym>C</Acronym> program with PostgreSQL extension functions
69+ into a shared library. Localized SQL scripts and output-comparison
70+ files are also created for the tests that need them. The localization
71+ replaces macros in the source files with absolute pathnames and user names.
7572</Para>
7673
7774<Para>
78- Normally, the regressiontest should be run as thepg_superuser since
75+ Normally, the regressiontests should be run as thepostgres user since
7976 the 'src/test/regress' directory and sub-directories are owned by the
80- pg_superuser . If you run the regression test as another user the
81- 'src/test/regress' directory treeshould be writeable to that user.
77+ postgres user . If you run the regression test as another user the
78+ 'src/test/regress' directory treemust be writeable to that user.
8279</Para>
8380
8481<Para>
@@ -132,7 +129,7 @@ The runtime path is /usr/local/pgsql (other paths are possible).
132129 expected/ . .out files that represent what we *expect* the results to
133130 look like
134131
135- results/ .. .out files thatrepresent what the results *actually* look
132+ results/ .. .out files thatcontain what the results *actually* look
136133 like. Also used as temporary storage for table copy testing.
137134 </ProgramListing>
138135 </Para>
@@ -296,25 +293,6 @@ The runtime path is /usr/local/pgsql (other paths are possible).
296293
297294 </Sect2>
298295
299- <Sect2>
300- <Title>OID differences</Title>
301-
302- <Para>
303- There are several places where PostgreSQL OID (object identifiers) appear
304- in 'regress.out'. OID's are unique 32-bit integers which are generated
305- by the PostgreSQL backend whenever a table row is inserted or updated.
306- If you run the regression test on a non-virgin database or run it multiple
307- times, the OID's reported will have different values.
308-
309- The following SQL statements in 'misc.out' have shown this behavior:
310-
311- QUERY: SELECT user_relns() AS user_relns ORDER BY user_relns;
312-
313- The 'a,523676' row is composed from an OID.
314- </Para>
315-
316- </Sect2>
317-
318296 <Sect2>
319297 <Title>Date and time differences</Title>
320298
@@ -431,5 +409,55 @@ The runtime path is /usr/local/pgsql (other paths are possible).
431409 </Sect2>
432410
433411 </Sect1>
412+
413+ <Sect1>
414+ <Title>Platform-specific comparison files</Title>
415+
416+ <Para>
417+ Since some of the tests inherently produce platform-specific results,
418+ we have provided a way to supply platform-specific result comparison
419+ files. Frequently, the same variation applies to multiple platforms;
420+ rather than supplying a separate comparison file for every platform,
421+ there is a mapping file that defines which comparison file to use.
422+ So, to eliminate bogus test "failures" for a particular platform,
423+ you must choose or make a variant result file, and then add a line
424+ to the mapping file, which is "resultmap".
425+ </Para>
426+
427+ <Para>
428+ Each line in the mapping file is of the form
429+ <ProgramListing>
430+ testname/platformnamepattern=comparisonfilename
431+ </ProgramListing>
432+ The test name is just the name of the particular regression test module.
433+ The platform name pattern is a pattern in the style of expr(1) (that is,
434+ a regular expression with an implicit ^ anchor at the start). It is matched
435+ against the platform name as printed by config.guess. The comparison
436+ file name is the name of the substitute result comparison file.
437+ </Para>
438+
439+ <Para>
440+ For example: the int2 regress test includes a deliberate entry of a value
441+ that is too large to fit in int2. The specific error message that is
442+ produced is platform-dependent; our reference platform emits
443+ <ProgramListing>
444+ ERROR: pg_atoi: error reading "100000": Numerical result out of range
445+ </ProgramListing>
446+ but a fair number of other Unix platforms emit
447+ <ProgramListing>
448+ ERROR: pg_atoi: error reading "100000": Result too large
449+ </ProgramListing>
450+ Therefore, we provide a variant comparison file, int2-too-large.out,
451+ that includes this spelling of the error message. To silence the
452+ bogus "failure" message on HPPA platforms, resultmap includes
453+ <ProgramListing>
454+ int2/hppa=int2-too-large
455+ </ProgramListing>
456+ which will trigger on any machine for which config.guess's output
457+ begins with 'hppa'. Other lines in resultmap select the variant
458+ comparison file for other platforms where it's appropriate.
459+ </Para>
460+
461+ </Sect1>
434462
435463</Chapter>