annotate tests/test-exclude1.sh @ 16364:89227b989588

fatal-signal: use C prototypes (with explicit void). * lib/fatal-signal.c (uninstall_handlers, install_handlers) (init_fatal_signal_set, block_fatal_signals): Fix signatures.
author Akim Demaille <demaille@gostai.com>
date Wed, 08 Feb 2012 10:36:20 +0100
parents 8250f2777afc
children e542fd46ad6f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11811
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
1 #! /bin/sh
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
2 # Test suite for exclude.
16201
8250f2777afc maint: update all copyright year number ranges
Jim Meyering <meyering@redhat.com>
parents: 16081
diff changeset
3 # Copyright (C) 2009-2012 Free Software Foundation, Inc.
11811
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
4 # This file is part of the GNUlib Library.
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
5 #
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
6 # This program is free software: you can redistribute it and/or modify
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
7 # it under the terms of the GNU General Public License as published by
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
8 # the Free Software Foundation; either version 3 of the License, or
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
9 # (at your option) any later version.
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
10 #
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
11 # This program is distributed in the hope that it will be useful,
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
14 # GNU General Public License for more details.
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
15 #
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
16 # You should have received a copy of the GNU General Public License
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
18
16081
ab4fc7286686 revamp the other test-exclude?.sh scripts to use init.sh, too
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
19 . "${srcdir=.}/init.sh"; path_prepend_ .
ab4fc7286686 revamp the other test-exclude?.sh scripts to use init.sh, too
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
20 fail=0
11811
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
21
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
22 # Test literal matches
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
23
16081
ab4fc7286686 revamp the other test-exclude?.sh scripts to use init.sh, too
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
24 cat > in <<EOT
11811
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
25 foo*
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
26 bar
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
27 Baz
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
28 EOT
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
29
16081
ab4fc7286686 revamp the other test-exclude?.sh scripts to use init.sh, too
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
30 cat > expected <<EOT
11811
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
31 foo: 0
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
32 foo*: 1
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
33 bar: 1
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
34 foobar: 0
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
35 baz: 0
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
36 bar/qux: 0
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
37 EOT
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
38
16081
ab4fc7286686 revamp the other test-exclude?.sh scripts to use init.sh, too
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
39 test-exclude in -- foo 'foo*' bar foobar baz bar/qux > out || exit $?
ab4fc7286686 revamp the other test-exclude?.sh scripts to use init.sh, too
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
40
ab4fc7286686 revamp the other test-exclude?.sh scripts to use init.sh, too
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
41 # Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
ab4fc7286686 revamp the other test-exclude?.sh scripts to use init.sh, too
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
42 # does not understand '\r'.
ab4fc7286686 revamp the other test-exclude?.sh scripts to use init.sh, too
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
43 case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
11811
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
44
16081
ab4fc7286686 revamp the other test-exclude?.sh scripts to use init.sh, too
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
45 # normalize output
ab4fc7286686 revamp the other test-exclude?.sh scripts to use init.sh, too
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
46 LC_ALL=C tr -d "$cr" < out > k && mv k out
ab4fc7286686 revamp the other test-exclude?.sh scripts to use init.sh, too
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
47
ab4fc7286686 revamp the other test-exclude?.sh scripts to use init.sh, too
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
48 compare expected out || fail=1
ab4fc7286686 revamp the other test-exclude?.sh scripts to use init.sh, too
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
49
ab4fc7286686 revamp the other test-exclude?.sh scripts to use init.sh, too
Jim Meyering <meyering@redhat.com>
parents: 14079
diff changeset
50 Exit $fail