home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre4.z / postgre4 / newconf / regress < prev    next >
Encoding:
Text File  |  1992-08-27  |  1.3 KB  |  68 lines

  1. #!/bin/sh
  2.  
  3. # set the defaults to do the right thing for a test on nod.
  4.  
  5. USAGE="Usage: regress [ -p platform ] [ -d target_dir ] [ -f ]"
  6. PG_NEWTREEDIR=/users/mer/pg.regress
  7. PG_PLATFORM=sparc
  8. FORCE=0
  9. MASTER_SRC=/usr/local/dev/postgres/mastertree
  10.  
  11. set - `getopt fd:p: $*`
  12. if [ $? != 0 ]
  13. then
  14.     echo $USAGE
  15.     exit 1
  16. fi
  17.  
  18. for opt in $*
  19. do
  20.     case $opt in
  21.     -f) FORCE=1; shift;;
  22.     -d) PG_NEWTREEDIR=$2; shift; shift;;
  23.     -p) PG_PLATFORM=$2; shift; shift;;
  24.     --) shift; break;;
  25.     esac
  26. done
  27.  
  28. if [ -d $PG_NEWTREEDIR -a $FORCE -eq 0 ]
  29. then
  30.     echo "$PG_NEWTREEDIR exists, still use it y/n (I will nuke it)?"
  31.     read response
  32.     if [ "$response" != "y" ]
  33.     then
  34.         echo Abort regression test
  35.         exit 1
  36.     fi
  37.     mv $PG_NEWTREEDIR `dirname $PG_NEWTREEDIR`/delme$$
  38.     rm -rf `dirname $PG_NEWTREEDIR`/delme$$
  39. fi
  40.  
  41. # check out a new tree
  42.  
  43. cd $MASTER_SRC/newconf
  44. ./newtree << EOF
  45. $PG_NEWTREEDIR
  46. y
  47. $PG_PLATFORM
  48. O
  49. EOF
  50.  
  51. # set up environment correctly
  52.  
  53. POSTGRESHOME=$PG_NEWTREEDIR
  54. PATH="$POSTGRESHOME/bin:$PATH"
  55. export POSTGRESHOME
  56. export PATH
  57.  
  58. # Change the default build configuration to optimize and ignore asserts
  59.  
  60. cd $POSTGRESHOME/newconf
  61. chmod 644 config.mk
  62. sed -e 's/-g/-O -DNO_ASSERT_CHECKING/' < config.mk > /tmp/regress$$
  63. mv /tmp/regress$$ ./config.mk
  64.  
  65. # Build the new tree and run all tests
  66.  
  67. ./Make everything install alltests
  68.