source: branches/0.9-stable/test/error_test.sh @ 1335

Last change on this file since 1335 was 1335, checked in by Peter Johansson, 11 years ago

avoid error message: Unknwon error 0

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1#!/bin/sh
2
3# $Id: error_test.sh 1335 2011-01-28 06:26:41Z 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
24required=
25
26. ./init.sh || exit 1
27
28# exit if cmd fails
29set -e
30
31SVNDIGEST_run 1 --root ${abs_top_srcdir}/README
32$GREP 'svndigest:' stderr || exit_fail
33$GREP "'${abs_top_srcdir}/README': " stderr || exit_fail
34
35SVNCOPYRIGHT_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
40SVNDIGEST_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
44SVNCOPYRIGHT_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
49SVNDIGEST_run 1 --rapakalja
50$GREP "svndigest: unrecognized option.*rapakalja" stderr || exit_fail
51
52SVNCOPYRIGHT_run 1 --rapakalja
53$GREP "svncopyright: unrecognized option.*rapakalja" stderr || exit_fail
54
55exit_success;
Note: See TracBrowser for help on using the repository browser.