Avoid leaking TEST_LOG_COMPILER in environment of test scripts.
[automake.git] / tests / instsh2.test
blob778c1a3e2c8c8d5fd0c92d684b49b95df933802d
1 #! /bin/sh
2 # Copyright (C) 2002, 2004, 2006, 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 # Various install-sh checks
19 . ./defs || Exit 1
20 set -e
22 # Basic errors
23 ./install-sh && Exit 1
24 ./install-sh -m 644 dest && Exit 1
26 # Directories
28 # It should be OK to create no directory. We sometimes need
29 # this when directory are conditionally defined.
30 ./install-sh -d
31 # One directory.
32 ./install-sh -d d0
33 test -d d0
34 # Multiple directories (for make installdirs).
35 ./install-sh -d d1 d2 d3 d4
36 test -d d1
37 test -d d2
38 test -d d3
39 test -d d4
40 # Subdirectories
41 ./install-sh -d p1/p2/p3 p4//p5//p6//
42 test -d p1/p2/p3
43 test -d p4/p5/p6
45 # Files.
46 : > x
47 ./install-sh -c -m 644 x y
48 test -f x
49 test -f y
50 ./install-sh -m 644 y z
51 test -f y
52 test -f z
53 # Multiple files
54 ./install-sh -m 644 -c x z d1
55 test -f x
56 test -f z
57 test -f d1/x
58 test -f d1/z
59 ./install-sh -m 644 x z d2//
60 test -f x
61 test -f z
62 test -f d2/x
63 test -f d2/z
64 ./install-sh -t d3 -m 644 x z
65 test -f x
66 test -f z
67 test -f d3/x
68 test -f d3/z
69 ./install-sh -t d4// -m 644 x z
70 test -f x
71 test -f z
72 test -f d4/x
73 test -f d4/z
74 ./install-sh -T x d3/y
75 test -f x
76 test -f d3/y
77 ./install-sh -T x d3 && Exit 1
78 ./install-sh -T x d4// && Exit 1
80 # Ensure that install-sh works with names that include spaces
81 touch 'a b'
82 mkdir 'x y'
83 ./install-sh 'a b' 'x y'
84 test -f x\ \ y/a\ \ b
85 test -f 'a b'