-
+
Regression Tests
-
Platform-specific comparison files
+
Platform-specific comparison files
- Since some of the tests inherently produce platform-specific results,
- we have provided a way to supply platform-specific result comparison
- files. Frequently, the same variation applies to multiple platforms;
- rather than supplying a separate comparison file for every platform,
- there is a mapping file that defines which comparison file to use.
- So, to eliminate bogus test "failures" for a particular platform,
- you must choose or make a variant result file, and then add a line
- to the mapping file, which is "resultmap".
-
+ Since some of the tests inherently produce platform-specific
+ results, we have provided a way to supply platform-specific result
+ comparison files. Frequently, the same variation applies to
+ multiple platforms; rather than supplying a separate comparison
+ file for every platform, there is a mapping file that defines
+ which comparison file to use. So, to eliminate bogus test
+ failures
for a particular platform, you must choose
+ or make a variant result file, and then add a line to the mapping
+ file, which is resultmap.
+
- Each line in the mapping file is of the form
- testname/platformnamepattern=comparisonfilename
-
- The test name is just the name of the particular regression test module.
- The platform name pattern is a pattern in the style of expr(1) (that is,
- a regular expression with an implicit ^ anchor at the start). It is matched
- against the platform name as printed by config.guess. The comparison
- file name is the name of the substitute result comparison file.
-
+ Each line in the mapping file is of the form
+
+testname/platformnamepattern=comparisonfilename
+
+ The test name is just the name of the particular regression test
+ module. The platform name pattern is a pattern in the style of
+ expr(1) (that is, a regular expression with an implicit ^ anchor
+ at the start). It is matched against the platform name as printed
+ by config.guess with an appended
+ :gcc or :cc, depending on
+ whether you use the GNU compiler or the system's native compiler
+ (on systems where there is a difference). The comparison file
+ name is the name of the substitute result comparison file.
+
- For example: the int2 regress test includes a deliberate entry of a value
- that is too large to fit in int2. The specific error message that is
- produced is platform-dependent; our reference platform emits
- ERROR: pg_atoi: error reading "100000": Numerical result out of range
-
- but a fair number of other Unix platforms emit
- ERROR: pg_atoi: error reading "100000": Result too large
-
- Therefore, we provide a variant comparison file, int2-too-large.out,
- that includes this spelling of the error message. To silence the
- bogus "failure" message on HPPA platforms, resultmap includes
- int2/hppa=int2-too-large
-
- which will trigger on any machine for which config.guess's output
- begins with 'hppa'. Other lines in resultmap select the variant
- comparison file for other platforms where it's appropriate.
-
+ For example: the int2 regression test includes a deliberate entry
+ of a value that is too large to fit in int2. The specific error
+ message that is produced is platform-dependent; our reference
+ platform emits
+
+ERROR: pg_atoi: error reading "100000": Numerical result out of range
+
+ but a fair number of other Unix platforms emit
+
+ERROR: pg_atoi: error reading "100000": Result too large
+
+ Therefore, we provide a variant comparison file,
+ int2-too-large.out, that includes this
+ spelling of the error message. To silence the bogus
+ failure
message on HPPA platforms, resultmap
+ includes
+int2/hppa=int2-too-large
+
+ which will trigger on any machine for which config.guess's output
+ begins with hppa
. Other lines
+ in resultmap select the variant comparison file for other
+ platforms where it's appropriate.
+
#! /bin/sh
-# $Header: /cvsroot/pgsql/src/test/regress/Attic/pg_regress.sh,v 1.11 2000/11/21 17:34:21 petere Exp $
+# $Header: /cvsroot/pgsql/src/test/regress/Attic/pg_regress.sh,v 1.12 2000/11/21 23:40:28 petere Exp $
me=`basename $0`
: ${TMPDIR=/tmp}
datadir='@datadir@'
host_platform='@host_tuple@'
enable_shared='@enable_shared@'
+GCC=@GCC@
+
+if [ "$GCC" = yes ]; then
+ compiler=gcc
+else
+ compiler=cc
+fi
unset mode
unset schedule
# ----------
# Scan resultmap file to find which platform-specific expected files to use.
# The format of each line of the file is
-# testname/hostplatformpattern=substitutefile
+# testname/hostplatformpattern=substitutefile
# where the hostplatformpattern is evaluated per the rules of expr(1),
# namely, it is a standard regular expression with an implicit ^ at the start.
+# What hostplatformpattern will be matched against is the config.guess output
+# followed by either ':gcc' or ':cc' (independent of the actual name of the
+# compiler executable).
#
# The tempfile hackery is needed because some shells will run the loop
# inside a subshell, whereupon shell variables set therein aren't seen
while read LINE
do
HOSTPAT=`expr "$LINE" : '.*/\(.*\)='`
- if [ `expr "$host_platform" : "$HOSTPAT"` -ne 0 ]
+ if [ `expr "$host_platform:$compiler" : "$HOSTPAT"` -ne 0 ]
then
# remove hostnamepattern from line so that there are no shell
# wildcards in SUBSTLIST; else later 'for' could expand them!