tests: remove recipes that run tests with 'prove'
[platform/upstream/automake.git] / t / mkinst3.sh
1 #! /bin/sh
2 # Copyright (C) 2005-2012 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 mkinstalldirs with spaces in directory names.
18
19 am_create_testdir=empty
20 . ./defs || Exit 1
21
22 # Make sure the directory we will create can be created...
23 mkdir '~a b' && mkdir '~a b/-x  y' \
24   || skip_ "directory names with spaces and metacharacters not accepted"
25 rm -rf '~a b'
26
27 get_shell_script mkinstalldirs
28
29 # Test mkinstalldirs with the installed mkdir.
30
31 ./mkinstalldirs '~a b/-x  y'
32 test -d '~a b/-x  y'
33 rm -rf '~a b'
34
35 # Trick mkinstalldirs into thinking mkdir does not support -p.
36
37 mkdir bin
38 cat >bin/mkdir <<'EOF'
39 #!/bin/sh
40 for arg
41 do
42   case $arg in
43   -p) exit 1;;
44   esac
45 done
46 PATH=$AM_PATH
47 export PATH
48 exec mkdir "$@"
49 EOF
50
51 chmod +x bin/mkdir
52 AM_PATH=$PATH
53 export AM_PATH
54 PATH=`pwd`/bin$PATH_SEPARATOR$PATH
55 export PATH
56
57 # Test mkinstalldirs without mkdir -p.
58
59 ./mkinstalldirs '~a b/-x  y'
60 test -d '~a b/-x  y'
61 rm -rf '~a b'
62
63 ./mkinstalldirs "`pwd`///~a b//-x  y"
64 test -d "`pwd`/~a b/-x  y"
65 rm -rf '~a b'