⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pg_regress.sh

📁 PostgreSQL 8.1.4的源码 适用于Linux下的开源数据库系统
💻 SH
📖 第 1 页 / 共 2 页
字号:
#! /bin/sh# $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.61 2005/11/01 15:09:11 adunstan Exp $me=`basename $0`: ${TMPDIR=/tmp}TMPFILE=$TMPDIR/pg_regress.$$help="\PostgreSQL regression test driverUsage: $me [options...] [extra tests...]Options:  --dbname=DB               use database DB (default \`regression')  --debug                   turn on debug mode in programs that are run  --inputdir=DIR            take input files from DIR (default \`.')  --load-language=lang      load the named language before running the                            tests; can appear multiple times  --max-connections=N       maximum number of concurrent connections                            (default is 0 meaning unlimited)  --multibyte=ENCODING      use ENCODING as the multibyte encoding, and                            also run a test by the same name  --outputdir=DIR           place output files in DIR (default \`.')  --schedule=FILE           use test ordering schedule from FILE                            (may be used multiple times to concatenate)  --temp-install[=DIR]      create a temporary installation (in DIR)  --no-locale               use C localeOptions for \`temp-install' mode:  --top-builddir=DIR        (relative) path to top level build directory  --temp-port=PORT          port number to start temp postmaster onOptions for using an existing installation:  --host=HOST               use postmaster running on HOST  --port=PORT               use postmaster running at PORT  --user=USER               connect as USERThe exit status is 0 if all tests passed, 1 if some tests failed, and 2if the tests could not be run for some reason.Report bugs to <pgsql-bugs@postgresql.org>."message(){    _dashes='==============' # 14    _spaces='                                      ' # 38    _msg=`echo "$1$_spaces" | cut -c 1-38`    echo "$_dashes $_msg $_dashes"}# ----------# Unset locale settings# ----------unset LC_COLLATE LC_CTYPE LC_MONETARY LC_MESSAGES LC_NUMERIC LC_TIME LC_ALL LANG LANGUAGE# On Windows the default locale may not be English, so force itcase $host_platform in    *-*-cygwin*|*-*-mingw32*)	LANG=en	export LANG	;;esac# ----------# Check for echo -n vs echo \c# ----------if echo '\c' | grep c >/dev/null 2>&1; then    ECHO_N='echo -n'    ECHO_C=''else    ECHO_N='echo'    ECHO_C='\c'fi# ----------# Initialize default settings# ----------: ${inputdir=.}: ${outputdir=.}libdir='@libdir@'bindir='@bindir@'datadir='@datadir@'host_platform='@host_tuple@'enable_shared='@enable_shared@'GCC=@GCC@if [ "$GCC" = yes ]; then    compiler=gccelse    compiler=ccfiunset modeunset scheduleunset debugunset nolocaleunset top_builddirunset temp_installunset multibytedbname=regressionhostname=localhostmaxconnections=0temp_port=65432load_langs="": ${GMAKE='@GMAKE@'}# ----------# Parse command line options# ----------while [ "$#" -gt 0 ]do    case $1 in        --help|-\?)                echo "$help"                exit 0;;        --version)                echo "pg_regress (PostgreSQL @VERSION@)"                exit 0;;        --dbname=*)                dbname=`expr "x$1" : "x--dbname=\(.*\)"`                shift;;        --debug)                debug=yes                shift;;        --inputdir=*)                inputdir=`expr "x$1" : "x--inputdir=\(.*\)"`                shift;;        --load-language=*)                lang=`expr "x$1" : "x--load-language=\(.*\)"`                load_langs="$load_langs $lang"                unset lang                shift;;        --multibyte=*)                multibyte=`expr "x$1" : "x--multibyte=\(.*\)"`                shift;;        --no-locale)                nolocale=yes                shift;;        --temp-install)                temp_install=./tmp_check                shift;;        --temp-install=*)                temp_install=`expr "x$1" : "x--temp-install=\(.*\)"`                shift;;        --max-connections=*)                maxconnections=`expr "x$1" : "x--max-connections=\(.*\)"`                shift;;        --outputdir=*)                outputdir=`expr "x$1" : "x--outputdir=\(.*\)"`                shift;;        --schedule=*)                foo=`expr "x$1" : "x--schedule=\(.*\)"`                schedule="$schedule $foo"                shift;;        --top-builddir=*)                top_builddir=`expr "x$1" : "x--top-builddir=\(.*\)"`                shift;;        --temp-port=*)                temp_port=`expr "x$1" : "x--temp-port=\(.*\)"`                shift;;        --host=*)                PGHOST=`expr "x$1" : "x--host=\(.*\)"`                export PGHOST                unset PGHOSTADDR                shift;;        --port=*)                PGPORT=`expr "x$1" : "x--port=\(.*\)"`                export PGPORT                shift;;        --user=*)                PGUSER=`expr "x$1" : "x--user=\(.*\)"`                export PGUSER                shift;;        -*)                echo "$me: invalid argument $1" 1>&2                exit 2;;        *)                extra_tests="$extra_tests $1"                shift;;    esacdone# ----------# warn of Cygwin likely failure if maxconnections = 0# and we are running parallel tests# ----------case $host_platform in    *-*-cygwin*)	case "$schedule" in	    *parallel_schedule*)		if [ $maxconnections -eq 0 ] ; then		    echo Using unlimited parallel connections is likely to fail or hang on Cygwin.		    echo Try \"$me --max-connections=n\" or \"gmake MAX_CONNECTIONS=n check\"		    echo with n = 5 or 10 if this happens.		    echo		fi		;;	esac	;;esac# ----------# On some platforms we can't use Unix sockets.# ----------case $host_platform in    *-*-cygwin* | *-*-mingw32* | *-*-qnx* | *beos*)        unix_sockets=no;;    *)        unix_sockets=yes;;esac# ----------# Set up diff to ignore horizontal white space differences.# ----------case $host_platform in    *-*-qnx* | *-*-sco3.2v5*)        DIFFFLAGS=-b;;    *)        DIFFFLAGS=-w;;esac# ----------# Set backend timezone and datestyle explicitly## To pass the horology test in its current form, the postmaster must be# started with PGDATESTYLE=ISO, while the frontend must be started with# PGDATESTYLE=Postgres.  We set the postmaster values here and change# to the frontend settings after the postmaster has been started.# ----------PGTZ='PST8PDT'; export PGTZPGDATESTYLE='ISO, MDY'; export PGDATESTYLE# ----------# Exit trap to remove temp file and shut down postmaster# ----------# Note:  There are some stupid shells (even among recent ones) that# ignore the argument to exit (as in `exit 1') if there is an exit# trap.  The trap (and thus the shell script) will then always exit# with the result of the last shell command before the `exit'.  Hence# we have to write `(exit x); exit' below this point.exit_trap(){     savestatus=$1    if [ -n "$postmaster_pid" ]; then        kill -2 "$postmaster_pid"        wait "$postmaster_pid"        unset postmaster_pid    fi    rm -f "$TMPFILE" && exit $savestatus}trap 'exit_trap $?' 0sig_trap() {    savestatus=$1    echo; echo "caught signal"    if [ -n "$postmaster_pid" ]; then        echo "signalling fast shutdown to postmaster with pid $postmaster_pid"        kill -2 "$postmaster_pid"        wait "$postmaster_pid"        unset postmaster_pid    fi    (exit $savestatus); exit}trap 'sig_trap $?' 1 2 13 15# ----------# Scan resultmap file to find which platform-specific expected files to use.# The format of each line of the file is#         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# outside the loop :-(# ----------cat /dev/null >$TMPFILEif [ -f "$inputdir/resultmap" ]then    while read LINE    do        HOSTPAT=`expr "$LINE" : '.*/\(.*\)='`        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!            TESTNAME=`expr "$LINE" : '\(.*\)/'`            SUBST=`echo "$LINE" | sed 's/^.*=//'`            echo "$TESTNAME=$SUBST" >> $TMPFILE        fi    done <"$inputdir/resultmap"fiSUBSTLIST=`cat $TMPFILE`rm -f $TMPFILELOGDIR=$outputdir/logif [ x"$temp_install" != x"" ]then    if echo x"$temp_install" | grep -v '^x/' >/dev/null 2>&1; then        temp_install="`pwd`/$temp_install"    fi    bindir=$temp_install/install/$bindir    libdir=$temp_install/install/$libdir    datadir=$temp_install/install/$datadir    PGDATA=$temp_install/data    if [ "$unix_sockets" = no ]; then        PGHOST=$hostname        export PGHOST        unset PGHOSTADDR    else        unset PGHOST        unset PGHOSTADDR    fi    # since Makefile isn't very bright, check for out-of-range temp_port    if [ "$temp_port" -ge 1024 -a "$temp_port" -le 65535 ] ; then	PGPORT=$temp_port    else	PGPORT=65432    fi    export PGPORT    # Get rid of environment stuff that might cause psql to misbehave    # while contacting our temp installation    unset PGDATABASE PGUSER PGSERVICE PGSSLMODE PGREQUIRESSL PGCONNECT_TIMEOUT    # ----------    # Set up shared library paths, needed by psql and pg_encoding    # (if you run multibyte).  LD_LIBRARY_PATH covers many platforms.    # DYLD_LIBRARY_PATH works on Darwin, and maybe other Mach-based systems.    # Feel free to account for others as well.    # ----------    if [ -n "$LD_LIBRARY_PATH" ]; then        LD_LIBRARY_PATH="$libdir:$LD_LIBRARY_PATH"    else        LD_LIBRARY_PATH=$libdir    fi    export LD_LIBRARY_PATH    if [ -n "$DYLD_LIBRARY_PATH" ]; then        DYLD_LIBRARY_PATH="$libdir:$DYLD_LIBRARY_PATH"    else        DYLD_LIBRARY_PATH=$libdir    fi    export DYLD_LIBRARY_PATH    # ----------    # Windows needs shared libraries in PATH. (Only those linked into    # executables, not dlopen'ed ones)    # ----------    case $host_platform in        *-*-cygwin*|*-*-mingw32*)            PATH=$libdir:$PATH            export PATH            ;;    esac    if [ -d "$temp_install" ]; then        message "removing existing temp installation"        rm -rf "$temp_install"    fi    message "creating temporary installation"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -