@@ -9,17 +9,15 @@ Regression test instructions and analysis.
9
9
10
10
<Para>
11
11
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.
15
14
</Para>
16
15
17
16
<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.
23
21
</Para>
24
22
25
23
<Para>
@@ -66,19 +64,18 @@ The runtime path is /usr/local/pgsql (other paths are possible).
66
64
<Title>Regression Environment</Title>
67
65
68
66
<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.
75
72
</Para>
76
73
77
74
<Para>
78
- Normally, the regression test should be run as the pg_superuser since
75
+ Normally, the regression tests should be run as the postgres user since
79
76
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 tree should be writeable to that user.
77
+ postgres user . If you run the regression test as another user the
78
+ 'src/test/regress' directory tree must be writeable to that user.
82
79
</Para>
83
80
84
81
<Para>
@@ -132,7 +129,7 @@ The runtime path is /usr/local/pgsql (other paths are possible).
132
129
expected/ . .out files that represent what we *expect* the results to
133
130
look like
134
131
135
- results/ .. .out files that represent what the results *actually* look
132
+ results/ .. .out files that contain what the results *actually* look
136
133
like. Also used as temporary storage for table copy testing.
137
134
</ProgramListing>
138
135
</Para>
@@ -296,25 +293,6 @@ The runtime path is /usr/local/pgsql (other paths are possible).
296
293
297
294
</Sect2>
298
295
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
-
318
296
<Sect2>
319
297
<Title>Date and time differences</Title>
320
298
@@ -431,5 +409,55 @@ The runtime path is /usr/local/pgsql (other paths are possible).
431
409
</Sect2>
432
410
433
411
</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>
434
462
435
463
</Chapter>
0 commit comments