xref: /netbsd-src/external/gpl2/gmake/dist/tests/scripts/functions/abspath (revision 69606e3f5c9388e52aed8c120ad63c049ca45d8f)
1*69606e3fSchristos#                                                                    -*-perl-*-
2*69606e3fSchristos$description = "Test the abspath functions.";
3*69606e3fSchristos
4*69606e3fSchristos$details = "";
5*69606e3fSchristos
6*69606e3fSchristosrun_make_test('
7*69606e3fSchristosifneq ($(realpath $(abspath .)),$(CURDIR))
8*69606e3fSchristos  $(warning .: abs="$(abspath .)" real="$(realpath $(abspath .))" curdir="$(CURDIR)")
9*69606e3fSchristosendif
10*69606e3fSchristos
11*69606e3fSchristosifneq ($(realpath $(abspath ./)),$(CURDIR))
12*69606e3fSchristos  $(warning ./: abs="$(abspath ./)" real="$(realpath $(abspath ./))" curdir="$(CURDIR)")
13*69606e3fSchristosendif
14*69606e3fSchristos
15*69606e3fSchristosifneq ($(realpath $(abspath .///)),$(CURDIR))
16*69606e3fSchristos  $(warning .///: abs="$(abspath .///)" real="$(realpath $(abspath .///))" curdir="$(CURDIR)")
17*69606e3fSchristosendif
18*69606e3fSchristos
19*69606e3fSchristosifneq ($(abspath /),/)
20*69606e3fSchristos  $(warning /: abspath="$(abspath /)")
21*69606e3fSchristosendif
22*69606e3fSchristos
23*69606e3fSchristosifneq ($(abspath ///),/)
24*69606e3fSchristos  $(warning ///: abspath="$(abspath ///)")
25*69606e3fSchristosendif
26*69606e3fSchristos
27*69606e3fSchristosifneq ($(abspath /.),/)
28*69606e3fSchristos  $(warning /.: abspath="$(abspath /.)")
29*69606e3fSchristosendif
30*69606e3fSchristos
31*69606e3fSchristosifneq ($(abspath ///.),/)
32*69606e3fSchristos  $(warning ///.: abspath="$(abspath ///.)")
33*69606e3fSchristosendif
34*69606e3fSchristos
35*69606e3fSchristosifneq ($(abspath /./),/)
36*69606e3fSchristos  $(warning /./: abspath="$(abspath /./)")
37*69606e3fSchristosendif
38*69606e3fSchristos
39*69606e3fSchristosifneq ($(abspath /.///),/)
40*69606e3fSchristos  $(warning /.///: abspath="$(abspath /.///)")
41*69606e3fSchristosendif
42*69606e3fSchristos
43*69606e3fSchristosifneq ($(abspath /..),/)
44*69606e3fSchristos  $(warning /..: abspath="$(abspath /..)")
45*69606e3fSchristosendif
46*69606e3fSchristos
47*69606e3fSchristosifneq ($(abspath ///..),/)
48*69606e3fSchristos  $(warning ///..: abspath="$(abspath ///..)")
49*69606e3fSchristosendif
50*69606e3fSchristos
51*69606e3fSchristosifneq ($(abspath /../),/)
52*69606e3fSchristos  $(warning /../: abspath="$(abspath /../)")
53*69606e3fSchristosendif
54*69606e3fSchristos
55*69606e3fSchristosifneq ($(abspath /..///),/)
56*69606e3fSchristos  $(warning /..///: abspath="$(abspath /..///)")
57*69606e3fSchristosendif
58*69606e3fSchristos
59*69606e3fSchristos
60*69606e3fSchristosifneq ($(abspath /foo/bar/..),/foo)
61*69606e3fSchristos  $(warning /foo/bar/..: abspath="$(abspath /foo/bar/..)")
62*69606e3fSchristosendif
63*69606e3fSchristos
64*69606e3fSchristosifneq ($(abspath /foo/bar/../../../baz),/baz)
65*69606e3fSchristos  $(warning /foo/bar/../../../baz: abspath="$(abspath /foo/bar/../../../baz)")
66*69606e3fSchristosendif
67*69606e3fSchristos
68*69606e3fSchristosifneq ($(abspath /foo/bar/../ /..),/foo /)
69*69606e3fSchristos  $(warning /foo/bar/../ /..: abspath="$(abspath /foo/bar/../ /..)")
70*69606e3fSchristosendif
71*69606e3fSchristos
72*69606e3fSchristos
73*69606e3fSchristos.PHONY: all
74*69606e3fSchristosall: ; @:
75*69606e3fSchristos',
76*69606e3fSchristos'',
77*69606e3fSchristos'');
78*69606e3fSchristos
79*69606e3fSchristos
80*69606e3fSchristos# This tells the test driver that the perl test script executed properly.
81*69606e3fSchristos1;
82