Testsuite: do not use `chmod -R' when cleaning up.
[automake.git] / tests / transform2.test
blob0f9d5ec081e7ab020a140825df308a68e3ebec92
1 #! /bin/sh
2 # Copyright (C) 2002, 2003, 2004, 2007, 2008 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 # Make sure that --program-transform works even when multiple files are
18 # collapsed.
20 . ./defs || Exit 1
22 set -e
24 cat >>configure.in <<'END'
25 AC_PROG_CC
26 AC_OUTPUT
27 END
29 cat >Makefile.am <<'EOF'
30 bin_PROGRAMS = p1 p2
31 bin_SCRIPTS = s1.sh s2.sh
32 man_MANS = m1.1 m2.1
34 test-install: install
35 test -f inst/bin/p$(EXEEXT)
36 test -f inst/bin/s.sh
37 test -f inst/man/man1/m.1
39 test-install-foo: install
40 test -f inst/bin/foo$(EXEEXT)
41 test -f inst/bin/foo
42 test -f inst/man/man1/foo.1
43 test ! -f inst/bin/p1$(EXEEXT)
44 test ! -f inst/bin/p2$(EXEEXT)
45 test ! -f inst/bin/s1.sh
46 test ! -f inst/bin/s2.sh
47 test ! -f inst/man/man/m1.1
48 test ! -f inst/man/man/m2.1
49 EOF
51 cat >p1.c <<'EOF'
52 int
53 main ()
55 return 0;
57 EOF
59 cp p1.c p2.c
61 : > s1.sh
62 : > s2.sh
63 : > m1.1
64 : > m2.1
66 $ACLOCAL
67 $AUTOCONF
68 $AUTOMAKE
70 ./configure --program-transform-name='s/[12]//' --prefix "`pwd`/inst" --mandir "`pwd`/inst/man"
71 $MAKE
72 $MAKE test-install
73 $MAKE uninstall
74 test `find inst -type f -print | wc -l` = 0
76 # Also squash all file types in question.
77 ./configure --program-transform-name='s/.*/foo/' --prefix "`pwd`/inst" --mandir "`pwd`/inst/man"
78 $MAKE
79 $MAKE test-install-foo
80 $MAKE uninstall
81 test `find inst -type f -print | wc -l` = 0