~ubuntu-branches/ubuntu/quantal/gnutls26/quantal

« back to all changes in this revision

Viewing changes to gl/tests/test-vc-list-files-cvs.sh

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-05-20 13:07:18 UTC
  • mfrom: (12.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20110520130718-db41dybbanzfvlji
Tags: 2.10.5-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Fix build failure with --no-add-needed.
  - Build for multiarch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
# Unit tests for vc-list-files
3
 
# Copyright (C) 2008 Free Software Foundation, Inc.
 
3
# Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
4
4
# This file is part of the GNUlib Library.
5
5
#
6
6
# This program is free software: you can redistribute it and/or modify
16
16
# You should have received a copy of the GNU General Public License
17
17
# along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
18
18
 
19
 
tmpdir=vc-cvs-$$
20
 
trap 'st=$?; cd '"`pwd`"' && rm -rf $tmpdir; exit $st' 0
21
 
trap '(exit $?); exit $?' 1 2 13 15
22
 
 
23
 
if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
24
 
  compare() { diff -u "$@"; }
25
 
elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
26
 
  compare() { cmp -s "$@"; }
27
 
else
28
 
  compare() { cmp "$@"; }
29
 
fi
30
 
 
 
19
: ${srcdir=.}
 
20
. "$srcdir/init.sh"; path_prepend_ .
 
21
 
 
22
tmpdir=vc-cvs
31
23
repo=`pwd`/$tmpdir/repo
32
24
 
33
25
fail=0
46
38
    # without cvs, skip the test
47
39
    # The double use of 'exit' is needed for the reference to $? inside the trap.
48
40
    { ( cvs -Q -d "$repo" init ) > /dev/null 2>&1 \
49
 
      || { echo "Skipping test: cvs not found in PATH"; (exit 77); exit 77; }; } &&
 
41
      || skip_ "cvs not found in PATH"; } &&
50
42
    mkdir w && cd w &&
51
43
    mkdir d &&
52
44
    touch d/a b c &&
59
51
  test $ok = 0 && fail=1
60
52
done
61
53
 
62
 
(exit $fail); exit $fail
 
54
Exit $fail