Merge branch 'simplify-exit-trap-workaround' into maint
[platform/upstream/automake.git] / t / missing3.sh
1 #! /bin/sh
2 # Copyright (C) 2004-2012 Free Software Foundation, Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 # Test missing when running a tool's --version.
18
19 am_create_testdir=empty
20 . ./defs || exit 1
21
22 get_shell_script missing
23
24 # b7cb8259 assumed not to exist.
25
26 ./missing b7cb8259 --version 2>stderr && { cat stderr >&2; exit 1; }
27 cat stderr >&2
28 grep . stderr && exit 1
29 ./missing b7cb8259 --grep 2>stderr && { cat stderr >&2; exit 1; }
30 cat stderr >&2
31 grep WARNING stderr
32
33 ./missing --run b7cb8259 --version && exit 1
34 ./missing --run b7cb8259 --grep 2>stderr && { cat stderr >&2; exit 1; }
35 cat stderr >&2
36 grep WARNING stderr
37
38 # missing itself it known to exist :)
39
40 ./missing ./missing --version 2>stderr && { cat stderr >&2; exit 1; }
41 cat stderr >&2
42 grep . stderr && exit 1
43 ./missing ./missing --grep 2>stderr && { cat stderr >&2; exit 1; }
44 cat stderr >&2
45 grep WARNING stderr
46
47 ./missing --run ./missing --version 2>stderr || { cat stderr >&2; exit 1; }
48 cat stderr >&2
49 grep . stderr && exit 1
50 ./missing --run ./missing --grep 2>stderr && { cat stderr >&2; exit 1; }
51 cat stderr >&2
52 grep WARNING stderr && exit 1
53 grep Unknown stderr