annotate tests/test-exclude1.sh @ 12839:c6d23570567d

Work around getdelim() bug on FreeBSD 8.0.
author Bruno Haible <bruno@clisp.org>
date Sun, 31 Jan 2010 17:43:25 +0100
parents c2cbabec01dd
children 97fc9a21a8fb
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.
12559
c2cbabec01dd update nearly all FSF copyright year lists to include 2010
Jim Meyering <meyering@redhat.com>
parents: 11855
diff changeset
3 # Copyright (C) 2009, 2010 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
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
19 TMP=excltmp.$$
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
20 LIST=flist.$$
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
21 ERR=0
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
22
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
23 # Test literal matches
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
24
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
25 cat > $LIST <<EOT
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
26 foo*
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
27 bar
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
28 Baz
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
29 EOT
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
30
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
31 cat > $TMP <<EOT
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
32 foo: 0
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
33 foo*: 1
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
34 bar: 1
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
35 foobar: 0
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
36 baz: 0
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
37 bar/qux: 0
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
38 EOT
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
39
11855
e53ecd6bb7d0 exclude-tests: Handle Windows EOL.
Simon Josefsson <simon@josefsson.org>
parents: 11811
diff changeset
40 ./test-exclude$EXEEXT $LIST -- foo 'foo*' bar foobar baz bar/qux |
e53ecd6bb7d0 exclude-tests: Handle Windows EOL.
Simon Josefsson <simon@josefsson.org>
parents: 11811
diff changeset
41 tr -d '\015' |
e53ecd6bb7d0 exclude-tests: Handle Windows EOL.
Simon Josefsson <simon@josefsson.org>
parents: 11811
diff changeset
42 diff -c $TMP - || ERR=1
11811
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
43
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
44 rm -f $TMP $LIST
451cf730f520 Optimize exclude: use hash tables for non-wildcard patterns.
Sergey Poznyakoff <gray@gnu.org.ua>
parents:
diff changeset
45 exit $ERR