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