Debian Codegraph @

tests/scripts/functions/abspath

raw
1 # -*-perl-*-
2 $description = "Test the abspath functions.";
3
4 $details = "";
5
6 # Someone needs to rewrite this to be portable for Windows
7 $port_type eq 'W32' and return -1;
8
9 run_make_test('
10 ifneq ($(realpath $(abspath .)),$(CURDIR))
11 $(warning .: abs="$(abspath .)" real="$(realpath $(abspath .))" curdir="$(CURDIR)")
12 endif
13
14 ifneq ($(realpath $(abspath ./)),$(CURDIR))
15 $(warning ./: abs="$(abspath ./)" real="$(realpath $(abspath ./))" curdir="$(CURDIR)")
16 endif
17
18 ifneq ($(realpath $(abspath .///)),$(CURDIR))
19 $(warning .///: abs="$(abspath .///)" real="$(realpath $(abspath .///))" curdir="$(CURDIR)")
20 endif
21
22 ifneq ($(abspath /),/)
23 $(warning /: abspath="$(abspath /)")
24 endif
25
26 ifneq ($(abspath ///),/)
27 $(warning ///: abspath="$(abspath ///)")
28 endif
29
30 ifneq ($(abspath /.),/)
31 $(warning /.: abspath="$(abspath /.)")
32 endif
33
34 ifneq ($(abspath ///.),/)
35 $(warning ///.: abspath="$(abspath ///.)")
36 endif
37
38 ifneq ($(abspath /./),/)
39 $(warning /./: abspath="$(abspath /./)")
40 endif
41
42 ifneq ($(abspath /.///),/)
43 $(warning /.///: abspath="$(abspath /.///)")
44 endif
45
46 ifneq ($(abspath /..),/)
47 $(warning /..: abspath="$(abspath /..)")
48 endif
49
50 ifneq ($(abspath ///..),/)
51 $(warning ///..: abspath="$(abspath ///..)")
52 endif
53
54 ifneq ($(abspath /../),/)
55 $(warning /../: abspath="$(abspath /../)")
56 endif
57
58 ifneq ($(abspath /..///),/)
59 $(warning /..///: abspath="$(abspath /..///)")
60 endif
61
62
63 ifneq ($(abspath /foo/bar/..),/foo)
64 $(warning /foo/bar/..: abspath="$(abspath /foo/bar/..)")
65 endif
66
67 ifneq ($(abspath /foo/bar/../../../baz),/baz)
68 $(warning /foo/bar/../../../baz: abspath="$(abspath /foo/bar/../../../baz)")
69 endif
70
71 ifneq ($(abspath /foo/bar/../ /..),/foo /)
72 $(warning /foo/bar/../ /..: abspath="$(abspath /foo/bar/../ /..)")
73 endif
74
75
76 .PHONY: all
77 all: ; @:
78 ',
79 '',
80 '');
81
82
83 # This tells the test driver that the perl test script executed properly.
84 1;