source: trunk/test/copyright_cache_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: 2.0 KB
Line 
1#!/bin/sh
2
3# $Id: copyright_cache_test.sh 1525 2012-10-01 06:31:07Z peter $
4
5# Copyright (C) 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
22required="repo"
23
24. test/init.sh || exit 99
25
26# exit if cmd fails
27set -e
28
29file=Credits.txt
30cache_dir=$rootdir/alhambra/.svndigest
31cache_file=$cache_dir/${file}.svncopyright-cache
32rm -f $cache_file
33
34# mini config file
35cat > config <<EOF
36[copyright-alias]
37jari = Jari Häkkinen
38peter = Peter Johansson
39EOF
40
41$SVN revert -R $rootdir
42SVNCOPYRIGHT_run 0 -r $rootdir/alhambra --ignore-cache -v --config-file=config
43test -s stderr && exit_fail
44test -r $cache_file || exit_fail
45# check that we cache user name not alias
46grep peter $cache_file || exit_fail
47cp $cache_file cache.txt
48
49cat > correct.txt <<EOF
50Copyright (C) 2006 Jari Häkkinen
51Copyright (C) 2009 Peter Johansson
52EOF
53grep 'Copyright (C)' $rootdir/alhambra/$file > copyright.txt || exit_fail
54diff -u correct.txt copyright.txt || exit_fail
55
56# modify the cache file to allow us to detect that it is used
57sed 's/peter/winston/' $cache_file > ${cache_file}2
58mv ${cache_file}2 ${cache_file}
59cat $cache_file
60# create a config reflecting this name change
61sed 's/peter/winston/' config > config2
62
63# copyright update using cache created above
64$SVN revert -R $rootdir
65SVNCOPYRIGHT_run 0 -r $rootdir/alhambra -v --config-file=config2
66test -s stderr && exit_fail
67grep 'Copyright (C)' $rootdir/alhambra/$file > copyright2.txt || exit_fail
68diff -u correct.txt copyright.txt || exit_fail
69
70exit_success;
Note: See TracBrowser for help on using the repository browser.