test/error_test.sh

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