fastfetch: update to 2.30.1
[oi-userland.git] / components / database / postgresql-14 / files / pg_regress.sh
blob6c14cdec75733850b42774144e8dc9e73bc3814c
1 #!/bin/sh
3 # CDDL HEADER START
5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License (the "License").
7 # You may not use this file except in compliance with the License.
9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 # or http://www.opensolaris.org/os/licensing.
11 # See the License for the specific language governing permissions
12 # and limitations under the License.
14 # When distributing Covered Code, include this CDDL HEADER in each
15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 # If applicable, add the following below this CDDL HEADER, with the
17 # fields enclosed by brackets "[]" replaced with your own identifying
18 # information: Portions Copyright [yyyy] [name of copyright owner]
20 # CDDL HEADER END
22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
25 #ident "@(#)pg_regress.sh 1.1 09/10/13 SMI"
27 # Wrapper to run pg_regress using the test suite installed
28 # with the PostgreSQL packages
30 PG_ROOT=/usr/postgres/14
32 # Default values for arguments
34 REG_ROOT=${PG_ROOT}/lib/64/regress
35 PSQL_DIR=/usr/bin
36 PGREG_BIN=${PG_ROOT}/lib/64/pgxs/src/test/regress/pg_regress
37 PGREG_TMP=/var/tmp/pg_regress_14
39 if [ '$1' = '--help' ] ; then
40 cat <<EOF
41 Usage: pg_regress.sh
42 [--suite <testsuite>]
43 [--bindir <psql-dir>]
44 [--driver <pg_regress binary>]
45 [<pg_regress args>]
47 <testsuite> is the path to the installed test suite.
48 (default $REG_ROOT)
50 <psql-dir> - ignored
52 <pg_regress> is the path to the pg_regress test driver binary.
53 (default $PGREG_BIN)
55 These three options (if used) can be in any order.
57 Additional arguments are passed on to pg_regress. Typically, this
58 will be --schedule=<schedule file>.
60 The PostgreSQL server must already be running on the same host.
61 The environment variable PGPORT must be set if the server is not using
62 the default 5432.
64 A copy of the testsuite as well as output, will be placed in the directory
65 /var/tmp/pg_regress_14 and subdirectories; any previous contents will be
66 removed before the test starts.
67 EOF
68 exit 0
71 if echo $* | grep -- --top-builddir > /dev/null ; then
72 echo "\"--top-builddir\" option is not available for this packaged test driver."
73 echo "Please start your PostgreSQL server separately."
74 exit 1
77 parse=true
79 while [ $parse = true ] ; do
80 case $1 in
81 '--suite' )
82 REG_ROOT=$2
83 shift 2
85 '--bindir' )
86 PSQL_DIR=$2
87 shift 2
89 '--driver' )
90 PGREG_BIN=$2
91 shift 2
93 * )
94 parse=false
96 esac
97 done
99 # pg_regress really only works with write permission on input directory,
100 # so need to create a similar directory structure to satisfy it
102 if [ -d "$PGREG_TMP" ] ; then
103 /usr/bin/rm -rf "${PGREG_TMP}"
105 mkdir -p "${PGREG_TMP}"
108 cd "${PGREG_TMP}"
109 cp -pR $REG_ROOT/* .
111 chmod o+w sql expected
112 mkdir results testtablespace
114 exec $PGREG_BIN $*