1 | #!/bin/sh |
---|
2 | |
---|
3 | # $Id: error_test.sh 1373 2011-06-10 23:31:35Z peter $ |
---|
4 | |
---|
5 | # Copyright (C) 2010, 2011 Peter Johansson |
---|
6 | # |
---|
7 | # This file is part of svndigest, http://dev.thep.lu.se/svndigest |
---|
8 | # |
---|
9 | # svndigest is free software; you can redistribute it and/or modify it |
---|
10 | # under the terms of the GNU General Public License as published by |
---|
11 | # the Free Software Foundation; either version 3 of the License, or |
---|
12 | # (at your option) any later version. |
---|
13 | # |
---|
14 | # svndigest is distributed in the hope that it will be useful, but |
---|
15 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
17 | # General Public License for more details. |
---|
18 | # |
---|
19 | # You should have received a copy of the GNU General Public License |
---|
20 | # along with svndigest. If not, see <http://www.gnu.org/licenses/>. |
---|
21 | |
---|
22 | # testing the output and return value of some expected failures |
---|
23 | |
---|
24 | required= |
---|
25 | |
---|
26 | . ./init.sh || exit 1 |
---|
27 | |
---|
28 | # exit if cmd fails |
---|
29 | set -e |
---|
30 | |
---|
31 | SVNDIGEST_run 1 --root ${abs_top_srcdir}/README |
---|
32 | $GREP 'svndigest:' stderr || exit_fail |
---|
33 | $GREP "'${abs_top_srcdir}/README': " stderr || exit_fail |
---|
34 | |
---|
35 | SVNCOPYRIGHT_run 1 --root ${abs_top_srcdir}/README |
---|
36 | $GREP 'svncopyright:' stderr || exit_fail |
---|
37 | $GREP "'${abs_top_srcdir}/README': " stderr || exit_fail |
---|
38 | $GREP "Unknown error" stderr && exit_fail |
---|
39 | |
---|
40 | SVNDIGEST_run 1 --root . |
---|
41 | $GREP "svndigest: '.*' is not a working copy" stderr || exit_fail |
---|
42 | $GREP "svndigest: '.*' is not a working copy.*is not a working copy" stderr\ |
---|
43 | && exit_fail |
---|
44 | SVNCOPYRIGHT_run 1 --root . |
---|
45 | $GREP "svncopyright: '.*' is not a working copy" stderr || exit_fail |
---|
46 | $GREP "svncopyright: '.*' is not a working copy.*is not a working copy" stderr\ |
---|
47 | && exit_fail |
---|
48 | |
---|
49 | SVNDIGEST_run 1 --rapakalja |
---|
50 | $GREP "svndigest: unrecognized option.*rapakalja" stderr || exit_fail |
---|
51 | |
---|
52 | SVNCOPYRIGHT_run 1 --rapakalja |
---|
53 | $GREP "svncopyright: unrecognized option.*rapakalja" stderr || exit_fail |
---|
54 | |
---|
55 | exit_success; |
---|