568 |
12 Mar 08 |
peter |
# @configure_input@ |
568 |
12 Mar 08 |
peter |
2 |
|
267 |
01 May 07 |
jari |
# $Id$ |
246 |
28 Apr 07 |
peter |
4 |
|
978 |
12 Dec 09 |
peter |
# Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson |
1601 |
06 Sep 15 |
peter |
# Copyright (C) 2009, 2010, 2011, 2012, 2015 Peter Johansson |
327 |
18 May 07 |
jari |
7 |
# |
687 |
04 Aug 08 |
peter |
# This file is part of svndigest, http://dev.thep.lu.se/svndigest |
327 |
18 May 07 |
jari |
9 |
# |
327 |
18 May 07 |
jari |
# svndigest is free software; you can redistribute it and/or modify it |
327 |
18 May 07 |
jari |
# under the terms of the GNU General Public License as published by |
693 |
11 Sep 08 |
jari |
# the Free Software Foundation; either version 3 of the License, or |
327 |
18 May 07 |
jari |
# (at your option) any later version. |
327 |
18 May 07 |
jari |
14 |
# |
327 |
18 May 07 |
jari |
# svndigest is distributed in the hope that it will be useful, but |
327 |
18 May 07 |
jari |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
327 |
18 May 07 |
jari |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
327 |
18 May 07 |
jari |
# General Public License for more details. |
327 |
18 May 07 |
jari |
19 |
# |
327 |
18 May 07 |
jari |
# You should have received a copy of the GNU General Public License |
693 |
11 Sep 08 |
jari |
# along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
327 |
18 May 07 |
jari |
22 |
|
1525 |
01 Oct 12 |
peter |
exit_fail () |
1525 |
01 Oct 12 |
peter |
24 |
{ |
1359 |
31 May 11 |
peter |
set +x |
1525 |
01 Oct 12 |
peter |
echo "$me: failed test: $@"; |
952 |
06 Dec 09 |
peter |
exit 1 |
952 |
06 Dec 09 |
peter |
28 |
} |
952 |
06 Dec 09 |
peter |
29 |
|
1525 |
01 Oct 12 |
peter |
exit_skip () |
1525 |
01 Oct 12 |
peter |
31 |
{ |
1359 |
31 May 11 |
peter |
set +x |
1525 |
01 Oct 12 |
peter |
echo "$me: skipped test: $@" |
952 |
06 Dec 09 |
peter |
exit 77 |
952 |
06 Dec 09 |
peter |
35 |
} |
952 |
06 Dec 09 |
peter |
36 |
|
1525 |
01 Oct 12 |
peter |
exit_success () |
1525 |
01 Oct 12 |
peter |
38 |
{ |
1359 |
31 May 11 |
peter |
set +x |
1525 |
01 Oct 12 |
peter |
echo "$me: successsful test: $@"; |
952 |
06 Dec 09 |
peter |
exit 0 |
952 |
06 Dec 09 |
peter |
42 |
} |
952 |
06 Dec 09 |
peter |
43 |
|
952 |
06 Dec 09 |
peter |
# primary variables - set by config.status |
748 |
09 Jan 09 |
peter |
abs_top_builddir=@abs_top_builddir@ |
1092 |
12 Jun 10 |
peter |
abs_top_srcdir=@abs_top_srcdir@ |
748 |
09 Jan 09 |
peter |
abs_builddir=@abs_builddir@ |
952 |
06 Dec 09 |
peter |
mkdir_p="@MKDIR_P@" |
952 |
06 Dec 09 |
peter |
repo="@abs_test_repo@" |
952 |
06 Dec 09 |
peter |
shell=@SHELL@ |
952 |
06 Dec 09 |
peter |
test_repo_found=@test_repo_found@ |
1337 |
12 Feb 11 |
peter |
have_svn_wc="@have_svn_wc@" |
952 |
06 Dec 09 |
peter |
53 |
|
1153 |
07 Aug 10 |
peter |
test -z "$SVNDIGEST" && SVNDIGEST="${abs_top_builddir}/bin/svndigest"; |
1293 |
14 Nov 10 |
peter |
test -z "$SVNDIGEST_COPY_CACHE" \ |
1293 |
14 Nov 10 |
peter |
&& SVNDIGEST_COPY_CACHE="${abs_top_builddir}/bin/svndigest-copy-cache"; |
1092 |
12 Jun 10 |
peter |
test -z "$SVNCOPYRIGHT" && SVNCOPYRIGHT="${abs_top_builddir}/bin/svncopyright"; |
952 |
06 Dec 09 |
peter |
test -z "$srcdir" && srcdir="@srcdir@"; |
1280 |
06 Nov 10 |
peter |
test -z "$SVN" && SVN="svn --non-interactive"; |
1220 |
13 Oct 10 |
peter |
test -z "$GREP" && GREP=@GREP@; |
952 |
06 Dec 09 |
peter |
61 |
|
952 |
06 Dec 09 |
peter |
# some helpful derived variables |
1092 |
12 Jun 10 |
peter |
rootdir=toy_project |
952 |
06 Dec 09 |
peter |
repo_url="file://$repo" |
1092 |
12 Jun 10 |
peter |
svn_update=${abs_builddir}/svn_update.sh |
246 |
28 Apr 07 |
peter |
66 |
|
952 |
06 Dec 09 |
peter |
me=$0 |
744 |
08 Jan 09 |
peter |
68 |
|
1092 |
12 Jun 10 |
peter |
test_dir=`echo $me.dir | sed -e 's,.*[\\/],,'` |
1525 |
01 Oct 12 |
peter |
test_dir="test/testSubDir/$test_dir" |
1092 |
12 Jun 10 |
peter |
$mkdir_p --verbose $test_dir |
1092 |
12 Jun 10 |
peter |
cd $test_dir |
1092 |
12 Jun 10 |
peter |
73 |
|
1092 |
12 Jun 10 |
peter |
abs_wcdir=${abs_builddir}/${test_dir}/toy_project |
1092 |
12 Jun 10 |
peter |
75 |
|
952 |
06 Dec 09 |
peter |
for r in : $required; do |
952 |
06 Dec 09 |
peter |
case $r in |
952 |
06 Dec 09 |
peter |
repo*) |
952 |
06 Dec 09 |
peter |
if test x$test_repo_found = xyes; then |
1601 |
06 Sep 15 |
peter |
# test can set wc_revision if it requires different rev than HEAD |
1601 |
06 Sep 15 |
peter |
$shell ${svn_update} $wc_revision || exit_fail; |
952 |
06 Dec 09 |
peter |
else |
952 |
06 Dec 09 |
peter |
exit_skip "no test repository available"; |
952 |
06 Dec 09 |
peter |
fi;; |
952 |
06 Dec 09 |
peter |
wc) |
1337 |
12 Feb 11 |
peter |
if test x$have_svn_wc = xno; then |
952 |
06 Dec 09 |
peter |
exit_skip "not subversion working copy"; |
952 |
06 Dec 09 |
peter |
fi;; |
952 |
06 Dec 09 |
peter |
89 |
*) |
952 |
06 Dec 09 |
peter |
90 |
: |
952 |
06 Dec 09 |
peter |
esac |
952 |
06 Dec 09 |
peter |
done |
246 |
28 Apr 07 |
peter |
93 |
|
1092 |
12 Jun 10 |
peter |
94 |
|
1092 |
12 Jun 10 |
peter |
foo_run () |
1092 |
12 Jun 10 |
peter |
96 |
{ |
1092 |
12 Jun 10 |
peter |
expected_exitcode=$1 |
1092 |
12 Jun 10 |
peter |
shift |
1092 |
12 Jun 10 |
peter |
exitcode=0 |
1092 |
12 Jun 10 |
peter |
$foo_prog ${1+"$@"} > stdout 2>stderr || exitcode=$? |
1092 |
12 Jun 10 |
peter |
cat stderr >&2 |
1092 |
12 Jun 10 |
peter |
cat stdout |
1092 |
12 Jun 10 |
peter |
test $exitcode = $expected_exitcode || exit_fail |
1092 |
12 Jun 10 |
peter |
104 |
} |
1092 |
12 Jun 10 |
peter |
105 |
|
1092 |
12 Jun 10 |
peter |
SVNDIGEST_run () |
1092 |
12 Jun 10 |
peter |
107 |
{ |
1092 |
12 Jun 10 |
peter |
foo_prog="$SVNDIGEST --verbose" |
1092 |
12 Jun 10 |
peter |
foo_run $@ |
1092 |
12 Jun 10 |
peter |
110 |
} |
1092 |
12 Jun 10 |
peter |
111 |
|
1293 |
14 Nov 10 |
peter |
SVNDIGEST_COPY_CACHE_run () |
1293 |
14 Nov 10 |
peter |
113 |
{ |
1293 |
14 Nov 10 |
peter |
foo_prog="$SVNDIGEST_COPY_CACHE --verbose" |
1293 |
14 Nov 10 |
peter |
foo_run $@ |
1293 |
14 Nov 10 |
peter |
116 |
} |
1293 |
14 Nov 10 |
peter |
117 |
|
1092 |
12 Jun 10 |
peter |
SVNCOPYRIGHT_run () |
1092 |
12 Jun 10 |
peter |
119 |
{ |
1092 |
12 Jun 10 |
peter |
foo_prog="$SVNCOPYRIGHT" |
1092 |
12 Jun 10 |
peter |
foo_run $@ |
1092 |
12 Jun 10 |
peter |
122 |
} |
1092 |
12 Jun 10 |
peter |
123 |
|
1092 |
12 Jun 10 |
peter |
124 |
|
952 |
06 Dec 09 |
peter |
echo "=== running $me ===" |
539 |
27 Dec 07 |
peter |
126 |
|
1045 |
27 Mar 10 |
peter |
# turn on trace |
1045 |
27 Mar 10 |
peter |
set -x; |