Revert Automake license to GPLv2+.
[automake.git] / tests / missing5.test
bloba96e14eea44027a50732a646e610183598e9d154
1 #! /bin/sh
2 # Copyright (C) 2006 Free Software Foundation, Inc.
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.
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.
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/>.
17 # test how well `missing' finds output file names of various tools.
18 # PR automake/483.
20 . ./defs || Exit 1
22 set -e
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'`
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)
34 AC_OUTPUT
35 EOF
37 for tool in $needed_tools; do
38 cat >$tool.in <<EOF
39 #! /bin/sh
40 exec @$tool@ "\$@"
41 EOF
42 done
44 $AUTOCONF
45 ./configure
47 echo output-file > output-file
48 cp output-file my--output--file-o
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