test-release.sh

This commit is contained in:
Yevgen Muntyan 2011-04-16 18:46:51 -07:00
parent 35350a3dae
commit ec8c31f503

View File

@ -9,8 +9,9 @@ if [ ! -d $1 ]; then
fi
srcdir=`cd $1 && pwd`
shift
if [ "`cd $srcdir && hg st`" ]; then
if [ "`cd $srcdir && hg st | grep -v test-release.sh`" ]; then
echo "uncommitted changes, aborting"
exit 1
fi
@ -26,15 +27,19 @@ set_title() {
prepare() {
set_title "medit-release prepare"
do_or_die rm -fr $tmpdir/medit
do_or_die cd $tmpdir
do_or_die hg clone $srcdir medit
do_or_die cd medit
set_title "medit-release autogen.sh"
do_or_die ./autogen.sh
if [ ! -d $tmpdir/medit ]; then
do_or_die cd $tmpdir
do_or_die hg clone $srcdir medit
fi
if [ ! -e $tmpdir/medit/configure ]; then
do_or_die cd $tmpdir/medit
set_title "medit-release autogen.sh"
do_or_die ./autogen.sh
fi
}
check_unix() {
prepare
set_title "medit-release unix build"
do_or_die mkdir $tmpdir/build-unix
do_or_die cd $tmpdir/build-unix
@ -46,6 +51,7 @@ check_unix() {
}
check_no_python() {
prepare
set_title "medit-release unix-no-python build"
do_or_die mkdir $tmpdir/build-unix-no-python
do_or_die cd $tmpdir/build-unix-no-python
@ -56,14 +62,30 @@ check_no_python() {
}
check_python() {
prepare
set_title "medit-release unix-python build"
do_or_die mkdir $tmpdir/build-unix-python
do_or_die cd $tmpdir/build-unix-python
do_or_die $tmpdir/medit/configure --enable-dev-mode --enable-moo-module --disable-static
do_or_die $tmpdir/medit/configure --enable-dev-mode --enable-moo-module --enable-shared --disable-static
do_or_die make
}
check_user_build() {
prepare
set_title "medit-release user build"
do_or_die mkdir $tmpdir/build-user
do_or_die cd $tmpdir/build-user
do_or_die $tmpdir/medit/configure --enable-dev-mode
do_or_die make dist
do_or_die tar xjf medit-*.tar.bz2
do_or_die cd medit-*
do_or_die ./configure
do_or_die make
do_or_die make test
}
check_windows() {
prepare
set_title "medit-release windows build"
do_or_die mkdir $tmpdir/build-windows
do_or_die cd $tmpdir/build-windows
@ -74,12 +96,33 @@ check_windows() {
do_or_die mv medit-*.exe $tmpdir/files/
}
prepare
check_unix
check_no_python
check_python
check_windows
check_all() {
all_checks="unix user_build no_python python windows"
fail=false
echo "============================================================="
echo " Done."
echo "============================================================="
for check in `echo $all_checks`; do
if $0 $srcdir "check_$check"; then
eval "status_$check=ok"
else
eval "status_$check=FAIL"
fail=true
fi
done
if $fail; then
echo "FAILED"
for check in `echo $all_checks`; do
if [ `eval "status_$check"` = FAIL ]; then
echo "check_$check - FAIL"
fi
done
else
echo "SUCCESS, files are in $tmpdir/files/"
fi
}
if [ -n "$1" ]; then
$1 $srcdir || exit 1
else
check_all || exit 1
fi