Imported Upstream version 3.82
[platform/upstream/make.git] / tests / scripts / functions / realpath
1 #                                                                    -*-perl-*-
2 $description = "Test the realpath functions.";
3
4 $details = "";
5
6 run_make_test('
7 ifneq ($(realpath .),$(CURDIR))
8   $(error )
9 endif
10
11 ifneq ($(realpath ./),$(CURDIR))
12   $(error )
13 endif
14
15 ifneq ($(realpath .///),$(CURDIR))
16   $(error )
17 endif
18
19 ifneq ($(realpath /),/)
20   $(error )
21 endif
22
23 ifneq ($(realpath /.),/)
24   $(error )
25 endif
26
27 ifneq ($(realpath /./),/)
28   $(error )
29 endif
30
31 ifneq ($(realpath /.///),/)
32   $(error )
33 endif
34
35 ifneq ($(realpath /..),/)
36   $(error )
37 endif
38
39 ifneq ($(realpath /../),/)
40   $(error )
41 endif
42
43 ifneq ($(realpath /..///),/)
44   $(error )
45 endif
46
47 ifneq ($(realpath . /..),$(CURDIR) /)
48   $(error )
49 endif
50
51 .PHONY: all
52 all: ; @:
53 ',
54               '',
55               '');
56
57 # On Windows platforms, "//" means something special.  So, don't do these
58 # tests there.
59
60 if ($port_type ne 'W32') {
61   run_make_test('
62 ifneq ($(realpath ///),/)
63   $(error )
64 endif
65
66 ifneq ($(realpath ///.),/)
67   $(error )
68 endif
69
70 ifneq ($(realpath ///..),/)
71   $(error )
72 endif
73
74 .PHONY: all
75 all: ; @:',
76                 '',
77                 '');
78 }
79
80
81 # This tells the test driver that the perl test script executed properly.
82 1;