f3773cc6fa686c610410ff0c7b47761ca073b1bc
[platform/upstream/automake.git] / tests / missing5.test
1 #! /bin/sh
2 # Copyright (C) 2006  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 3, 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 how well `missing' finds output file names of various tools.
18 # PR automake/483.
19
20 . ./defs || Exit 1
21
22 set -e
23
24 # these programs may be invoked by `missing'
25 needed_tools='chmod find sed test touch'
26 needed_tools_csep=`echo $needed_tools | sed 's/ /, /g'`
27
28 cat >configure.in <<EOF
29 AC_INIT([missing4], [1.0])
30 m4_foreach([tool], [$needed_tools_csep],
31            [AC_PATH_PROG(tool, tool, [false])
32             AC_CONFIG_FILES(tool, chmod +x tool)
33            ])
34 AC_OUTPUT
35 EOF
36
37 for tool in $needed_tools; do
38   cat >$tool.in <<EOF
39 #! /bin/sh
40 exec @$tool@ "\$@"
41 EOF
42 done
43
44 $AUTOCONF
45 ./configure
46
47 echo output-file > output-file
48 cp output-file my--output--file-o
49
50 save_PATH=$PATH
51 PATH=.
52 export PATH
53 missing --help
54 missing --version
55 for tool in autom4te help2man makeinfo; do
56   missing --run $tool -o my--output--file-o input
57   missing --run $tool --output my--output--file-o input
58 done
59 PATH=$save_PATH
60 export PATH
61 diff output-file my--output--file-o
62 test ! -f ./--file-o
63 test ! -f input