~ chicken-core (chicken-5) /scripts/test-dist.sh
Trap1#!/bin/sh2### test-dist.sh - test distribution tarball3#4# usage: test-dist.sh [-bootstrap] PLATFORM [TARBALL]56set -e78pwdopts=9bootstrap=1011if test "$1" = "-bootstrap"; then12 bootstrap=113 shift14fi1516case $# in17 1|2) ;;18 *)19 echo "usage: test-dist.sh [-bootstrap] PLATFORM [TARBALL]"20 exit 1;;21esac2223platform="$1"24tarball="$2"25makeprg=gmake2627# use gmake, if available28if test -z `which gmake`; then29 makeprg=make30fi3132# need Windows-style drive letter on mingw/msys33if test -n "$MSYSTEM"; then34 pwdopts=-W35fi3637# bootstrap, if desired38prefix=`pwd $pwdopts`/tmp-test-dist3940if test \! -x "$prefix/bin/csi"; then41 echo "no csi at ${prefix} - please build and install chicken first"42 exit 143fi4445for ext in htmlprag matchable; do46 if test `$prefix/bin/csi -p "(extension-information '${ext})"` = "#f"; then47 $prefix/bin/chicken-install $ext48 fi49done5051if test -n "$bootstrap"; then52 $makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 bootstrap53 $makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 CHICKEN=./chicken-boot confclean all install54fi5556# if no tarball given, create one57if test -z "$tarball"; then58 $prefix/bin/csi -s scripts/makedist.scm --make=$makeprg --platform=$platform59 tarball=chicken-`cat buildversion`.tar.gz60fi6162# prepare testing directory63if test -d tmp-test-dist; then64 rm -fr tmp-test-dist/*65fi6667mkdir -p tmp-test-dist68cp "$tarball" tmp-test-dist6970# unpack and enter71cd tmp-test-dist72tar xvfz "$tarball"73cd `basename "$tarball" .tar.gz`7475# build #176$makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 all install77# check #178$makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 check79# build once again with freshly built compiler80touch *.scm81$makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 CHICKEN=$prefix/bin/chicken all install82# and check...83$makeprg PLATFORM=$platform PREFIX=$prefix DEBUGBUILD=1 check8485# Install a few eggs86$prefix/bin/chicken-install -test prometheus87$prefix/bin/chicken-install opengl8889echo "looks good."