From cff8972e40d9e2862476bc9f39d425b22b76b402 Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Fri, 5 Sep 2008 16:25:07 -0500 Subject: [PATCH] A test script --- tests/check.sh | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 tests/check.sh diff --git a/tests/check.sh b/tests/check.sh new file mode 100644 index 00000000..02446292 --- /dev/null +++ b/tests/check.sh @@ -0,0 +1,51 @@ +#! /bin/sh + +tipurl=http://mooedit.sourceforge.net/hg/hg.cgi/moo/archive/tip.tar.bz2 + +tmpdir= + +go_to_tmp() { + if [ -z "$tmpdir" ]; then + tmpdir="`mktemp`" + rm -f "$tmpdir" || exit 1 + echo "mkdir $tmpdir" + mkdir "$tmpdir" || exit 1 + cd "$tmpdir" + fi +} + +check_hg() { + go_to_tmp + wget $tipurl || exit 1 + tar xjf tip.tar.bz2 || exit 1 + cd moo-* || exit 1 + + ./autogen.sh || { echo "autogen.sh failed in $tmpdir"; exit 1; } + ./configure || { echo "configure failed in $tmpdir"; exit 1; } + make || { echo "make failed in $tmpdir"; exit 1; } + make distcheck || { echo "make distcheck failed in $tmpdir"; exit 1; } + + cd .. + rm -r $tmpdir + tmpdir= +} + +usage() { + echo "Usage: $0 check_hg" +} + +for arg; do + case "$arg" in + check_hg) + check_hg || exit 1 + ;; + --help) + usage + exit 0 + ;; + *) + usage + exit 1 + ;; + esac +done