VirtualBox

source: kBuild/trunk/src/kmk/tests/scripts/functions/root@ 2548

Last change on this file since 2548 was 2413, checked in by bird, 15 years ago

copyright year update.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1# $Id: root 2413 2010-09-11 17:43:04Z bird $ -*-perl-*-
2## @file
3# $(root path...)
4#
5
6#
7# Copyright (c) 2008-2010 knut st. osmundsen <[email protected]>
8#
9# This file is part of kBuild.
10#
11# kBuild is free software; you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 3 of the License, or
14# (at your option) any later version.
15#
16# kBuild is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with kBuild. If not, see <http://www.gnu.org/licenses/>
23#
24#
25
26$description = "Tests the $(path ) function";
27
28$details = "Testing edges and some simple stuff.";
29
30if ($is_kmk) {
31
32 # TEST #0 - check that the feature is present.
33 # --------------------------------------------
34 run_make_test('
35ifneq ($(root /a),/)
36$(error sub-test 0 failed)
37endif
38.PHONY: all
39all: ; @:
40',
41'',
42'');
43
44 # TEST #1 - the real test.
45 # ------------------------
46 run_make_test('
47ifneq ($(root /asdf/asdf/adsf),/)
48$(error sub-test 0 failed:$(root /asdf/asdf/adsf))
49endif
50ifneq ($(root asdf/asdf/adsf),)
51$(error sub-test 1 failed)
52endif
53ifneq ($(root asdf/asdf/adsf/),)
54$(error sub-test 2 failed)
55endif
56ifneq ($(root asdf/asdf/adsf/),)
57$(error sub-test 3 failed)
58endif
59ifneq ($(root a),)
60$(error sub-test 4 failed)
61endif
62ifneq ($(root ),)
63$(error sub-test 5 failed)
64endif
65ifneq ($(root //a),//)
66$(error sub-test 6 failed)
67endif
68ifneq ($(root /a),/)
69$(error sub-test 7 failed)
70endif
71ifneq ($(root ///a),///)
72$(error sub-test 8 failed)
73endif
74ifneq ($(root /a /b /c d /e),/ / / /)
75$(error sub-test 9 failed)
76endif
77
78.PHONY: all
79all: ; @:
80',
81'',
82'');
83
84
85 # TEST #2 - DOS PATH stuff.
86 # ------------------------
87 if ($port_type eq 'W32' || $port_type eq 'OS/2' || $port_type eq 'DOS') {
88 run_make_test('
89ifneq ($(root D:),D:)
90$(error sub-test 0 failed)
91endif
92ifneq ($(root D:/),D:/)
93$(error sub-test 1 failed)
94endif
95ifneq ($(root D:\\),D:\\)
96$(error sub-test 2 failed)
97endif
98ifneq ($(root D:\\\\),D:\\\\)
99$(error sub-test 3 failed)
100endif
101ifneq ($(root D:\\\\a),D:\\\\)
102$(error sub-test 4 failed)
103endif
104ifneq ($(root D:\\/a),D:\\/)
105$(error sub-test 5 failed)
106endif
107ifneq ($(root a:\\\\//asdf/asdf\\asdf),a:\\\\//)
108$(error sub-test 6 failed)
109endif
110ifneq ($(root z://\\\\asdf/asdf\\asdf),z://\\\\)
111$(error sub-test 7 failed)
112endif
113
114.PHONY: all
115all: ; @:
116',
117'',
118'');
119 }
120
121 # TEST #3 - UNC PATH stuff.
122 # ------------------------
123 if ($port_type eq 'W32' || $port_type eq 'OS/2') {
124 run_make_test('
125ifneq ($(root //./),//./)
126$(error sub-test 0 failed)
127endif
128ifneq ($(root \\\\.\\),\\\\.\\)
129$(error sub-test 1 failed)
130endif
131ifneq ($(root \\\\\\.\\),\\\\\\)
132$(error sub-test 2 failed)
133endif
134ifneq ($(root ///.\\),///)
135$(error sub-test 3 failed)
136endif
137ifneq ($(root /\\.\\),/\\.\\)
138$(error sub-test 4 failed)
139endif
140ifneq ($(root \\/.\\),\\/.\\)
141$(error sub-test 5 failed)
142endif
143ifneq ($(root //srv/),//srv/)
144$(error sub-test 6 failed)
145endif
146ifneq ($(root //srv),)
147$(error sub-test 7 failed)
148endif
149ifneq ($(root //srv/share),//srv/share)
150$(error sub-test 8 failed)
151endif
152ifneq ($(root //srv/share/),//srv/share/)
153$(error sub-test 9 failed)
154endif
155ifneq ($(root //srv/share/asdf),//srv/share/)
156$(error sub-test 10 failed)
157endif
158
159.PHONY: all
160all: ; @:
161',
162'',
163'');
164 }
165
166}
167
168
169
170# Indicate that we're done.
1711;
172
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette