source: trunk/test/ignore_revs_test.sh @ 1525

Last change on this file since 1525 was 1525, checked in by Peter Johansson, 9 years ago

replace recursive Makefile with one single Makefile. Keeping multiple Makefile.ams which are included into main Makefile.am.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1#!/bin/sh
2# $Id: ignore_revs_test.sh 1525 2012-10-01 06:31:07Z peter $
3#
4# Copyright (C) 2011, 2012 Peter Johansson
5#
6# This file is part of svndigest, http://dev.thep.lu.se/svndigest
7#
8# svndigest is free software; you can redistribute it and/or modify it
9# under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 3 of the License, or
11# (at your option) any later version.
12#
13# svndigest is distributed in the hope that it will be useful, but
14# WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16# General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with svndigest. If not, see <http://www.gnu.org/licenses/>.
20
21required="repo"
22
23. test/init.sh || exit 99
24set -e
25
26run_svncopyright_with_ignore ()
27{
28ignore=$1
29$SVN revert -R toy_project
30cp toy_project/.svndigest/config config
31cat >> config << _EOF
32[svn-props]
33README = svncopyright:ignore=$ignore
34_EOF
35cat config
36# do not use --ignore-cache so we also test that cache is ignored automatically
37SVNCOPYRIGHT_run 0 --verbose --root toy_project --config-file=config
38}
39
40# no ignore
41SVNCOPYRIGHT_run 0 -v --ignore-cache --root toy_project
42$GREP "2006 Jari" toy_project/README || exit_fail
43$GREP "2007, 2008 Peter" toy_project/README || exit_fail
44
45run_svncopyright_with_ignore 42
46$GREP "2006 Jari" toy_project/README || exit_fail
47$GREP "Copyright (C) 2008 Peter" toy_project/README || exit_fail
48
49run_svncopyright_with_ignore "-42"
50$GREP "2006 Jari" toy_project/README && exit_fail
51$GREP "Copyright (C) 2008 Peter" toy_project/README || exit_fail
52
53run_svncopyright_with_ignore "41"
54$GREP "2006 Jari" toy_project/README || exit_fail
55$GREP "Copyright (C) 2007, 2008 Peter" toy_project/README || exit_fail
56
57run_svncopyright_with_ignore "1-34"
58$GREP "2006 Jari" toy_project/README || exit_fail
59$GREP "Copyright (C) 2007, 2008 Peter" toy_project/README || exit_fail
60
61run_svncopyright_with_ignore "1-35"
62$GREP "2006 Jari" toy_project/README && exit_fail
63$GREP "Copyright (C) 2007, 2008 Peter" toy_project/README || exit_fail
64
65run_svncopyright_with_ignore "42-"
66$GREP "2006 Jari" toy_project/README || exit_fail
67$GREP "Copyright (C) 2007, 2008 Peter" toy_project/README && exit_fail
68
69run_svncopyright_with_ignore "0-999"
70$GREP "Copyright (C)" toy_project/README || exit_fail
71
72# test that nonsense argument fails with grace
73$SVN revert toy_project -R
74cat > config << _EOF
75[svn-props]
76README = svncopyright:ignore=nonsense
77_EOF
78cat config
79# do not use --ignore-cache so we also test that cache is ignored automatically
80SVNCOPYRIGHT_run 1 -v --root toy_project --config-file=config
81$GREP svncopyright: stderr || exit_fail
82$GREP yat stderr && exit_fail
83
84# test ignore property on both Node and subNode
85$SVN revert toy_project -R
86cat > config << _EOF
87[copyright-alias]
88jari = Jari
89peter = Peter
90[svn-props]
91README = svncopyright:ignore=0-35
92toy_project = svncopyright:ignore=42
93_EOF
94cat config
95# do not use --ignore-cache so we also test that cache is ignored automatically
96SVNCOPYRIGHT_run 0 -v --root toy_project --config-file=config
97$GREP "Copyright (C) 2006" toy_project/README && exit_fail
98$GREP "Copyright (C) 2008" toy_project/README || exit_fail
99
100exit_success
Note: See TracBrowser for help on using the repository browser.