head	1.2;
access;
symbols;
locks; strict;
comment	@# @;


1.2
date	92.08.19.19.47.01;	author mer;	state Exp;
branches;
next	1.1;

1.1
date	92.08.10.22.59.37;	author mer;	state Exp;
branches;
next	;


desc
@regression test script
@


1.2
log
@make the new postgres binary directory seen before the old
@
text
@#!/bin/sh

# set the defaults to do the right thing for a test on nod.

USAGE="Usage: regress [ -p platform ] [ -d target_dir ] [ -f ]"
PG_NEWTREEDIR=/users/mer/pg.regress
PG_PLATFORM=sparc
FORCE=0
MASTER_SRC=/usr/local/dev/postgres/mastertree

set - `getopt fd:p: $*`
if [ $? != 0 ]
then
	echo $USAGE
	exit 1
fi

for opt in $*
do
	case $opt in
	-f) FORCE=1; shift;;
	-d) PG_NEWTREEDIR=$2; shift; shift;;
	-p) PG_PLATFORM=$2; shift; shift;;
	--) shift; break;;
	esac
done

if [ -d $PG_NEWTREEDIR -a $FORCE -eq 0 ]
then
	echo "$PG_NEWTREEDIR exists, still use it y/n (I will nuke it)?"
	read response
	if [ "$response" != "y" ]
	then
		echo Abort regression test
		exit 1
	fi
	mv $PG_NEWTREEDIR `dirname $PG_NEWTREEDIR`/delme$$
	rm -rf `dirname $PG_NEWTREEDIR`/delme$$
fi

# check out a new tree

cd $MASTER_SRC/newconf
./newtree << EOF
$PG_NEWTREEDIR
y
$PG_PLATFORM
O
EOF

# set up environment correctly

POSTGRESHOME=$PG_NEWTREEDIR
PATH="$POSTGRESHOME/bin:$PATH"
export POSTGRESHOME
export PATH

# Change the default build configuration to optimize and ignore asserts

cd $POSTGRESHOME/newconf
chmod 644 config.mk
sed -e 's/-g/-O -DNO_ASSERT_CHECKING/' < config.mk > /tmp/regress$$
mv /tmp/regress$$ ./config.mk

# Build the new tree and run all tests

./Make everything install alltests
@


1.1
log
@Initial revision
@
text
@d54 1
a54 1
PATH="$PATH:$POSTGRESHOME/bin"
@
