author | egahlin |
Fri, 30 Aug 2019 20:39:38 +0200 | |
branch | JEP-349-branch |
changeset 57971 | aa7b1ea52413 |
parent 54380 | e297c7bb6469 |
child 55166 | 2ae056696b15 |
permissions | -rw-r--r-- |
25854 | 1 |
# |
54380 | 2 |
# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. |
25854 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. Oracle designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
24 |
# |
|
25 |
||
26 |
default: all |
|
27 |
||
28 |
include $(SPEC) |
|
29 |
include MakeBase.gmk |
|
47334
09d386ddaa42
8189095: Import JMC from artifactory using Jib and main makefiles
erikj
parents:
47217
diff
changeset
|
30 |
include UtilsForTests.gmk |
25854 | 31 |
|
47217 | 32 |
THIS_FILE := $(TOPDIR)/test/make/TestMakeBase.gmk |
25854 | 33 |
DEPS := $(THIS_FILE) \ |
47217 | 34 |
$(TOPDIR)/make/common/MakeBase.gmk \ |
25854 | 35 |
# |
36 |
||
37 |
OUTPUT_DIR := $(TESTMAKE_OUTPUTDIR)/make-base |
|
28600
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
38 |
$(call MakeDir, $(OUTPUT_DIR)) |
25854 | 39 |
|
40 |
################################################################################ |
|
41 |
# Escape $ |
|
42 |
ifneq ($(call EscapeDollar, foo$$bar), foo\$$bar) |
|
43 |
$(error EscapeDollar failed $(call EscapeDollar, foo$$bar) foo\$$bar) |
|
44 |
endif |
|
45 |
||
46 |
ESCAPE_DOLLAR_DIR := $(OUTPUT_DIR)/escape-dollar |
|
47 |
||
48 |
$(ESCAPE_DOLLAR_DIR)/_escape_dollar: $(DEPS) |
|
49 |
$(RM) -r $(@D) |
|
50 |
$(MKDIR) -p $(@D) |
|
51 |
$(ECHO) foo\$$bar > $(@D)/file1 |
|
52 |
$(ECHO) $(call EscapeDollar, foo$$bar) > $(@D)/file2 |
|
53 |
$(ECHO) $(call EscapeDollar, foo\$$bar) > $(@D)/file3 |
|
54 |
$(DIFF) $(@D)/file1 $(@D)/file2 |
|
55 |
$(DIFF) $(@D)/file1 $(@D)/file3 |
|
56 |
$(TOUCH) $@ |
|
57 |
||
58 |
TEST_TARGETS += $(ESCAPE_DOLLAR_DIR)/_escape_dollar |
|
59 |
||
60 |
################################################################################ |
|
32553
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
61 |
# Test containing and not-containing |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
62 |
|
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
63 |
CONT_LIST := foo bar baz foobar foobaz |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
64 |
|
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
65 |
# Param 1 - string to look for |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
66 |
# Param 2 - expected result |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
67 |
define TestContaining |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
68 |
value := $$(call containing, $1, $(CONT_LIST)) |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
69 |
ifneq ($$(value), $2) |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
70 |
$$(info (call containing, $1, $(CONT_LIST))) |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
71 |
$$(error result >$$(value)<, expected >$2<) |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
72 |
endif |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
73 |
endef |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
74 |
|
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
75 |
$(eval $(call TestContaining,bar,bar foobar)) |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
76 |
$(eval $(call TestContaining,foo bar,foo bar foobar foobaz)) |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
77 |
|
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
78 |
# Param 1 - string to look for |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
79 |
# Param 2 - expected result |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
80 |
define TestNotContaining |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
81 |
value := $$(call not-containing, $1, $(CONT_LIST)) |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
82 |
ifneq ($$(value), $2) |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
83 |
$$(info (call not-containing, $1, $(CONT_LIST))) |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
84 |
$$(error result >$$(value)<, expected >$2<) |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
85 |
endif |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
86 |
endef |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
87 |
|
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
88 |
$(eval $(call TestNotContaining,bar,foo baz foobaz)) |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
89 |
$(eval $(call TestNotContaining,foo bar,baz)) |
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
90 |
|
418e3b5ff477
8136383: Improve make utilities containing and not-containing
erikj
parents:
30095
diff
changeset
|
91 |
################################################################################ |
28607
380f123263d8
8071651: infinite build loops in 9-dev windows platform on Jan 26
erikj
parents:
28600
diff
changeset
|
92 |
# Test Equals |
380f123263d8
8071651: infinite build loops in 9-dev windows platform on Jan 26
erikj
parents:
28600
diff
changeset
|
93 |
|
380f123263d8
8071651: infinite build loops in 9-dev windows platform on Jan 26
erikj
parents:
28600
diff
changeset
|
94 |
EQUALS_VALUE1 := value1$(SPACE) |
380f123263d8
8071651: infinite build loops in 9-dev windows platform on Jan 26
erikj
parents:
28600
diff
changeset
|
95 |
EQUALS_VALUE2 := value2 |
52186
0dac3131b0fd
8212587: equals in MakeBase does not handle empty strings correctly
ihse
parents:
47334
diff
changeset
|
96 |
EQUALS_EMPTY := |
28607
380f123263d8
8071651: infinite build loops in 9-dev windows platform on Jan 26
erikj
parents:
28600
diff
changeset
|
97 |
|
380f123263d8
8071651: infinite build loops in 9-dev windows platform on Jan 26
erikj
parents:
28600
diff
changeset
|
98 |
ifneq ($(call equals, $(EQUALS_VALUE1), $(EQUALS_VALUE2)), ) |
380f123263d8
8071651: infinite build loops in 9-dev windows platform on Jan 26
erikj
parents:
28600
diff
changeset
|
99 |
$(error The strings >$(EQUALS_VALUE1)< and >$(EQUALS_VALUE2)< are equal) |
380f123263d8
8071651: infinite build loops in 9-dev windows platform on Jan 26
erikj
parents:
28600
diff
changeset
|
100 |
endif |
380f123263d8
8071651: infinite build loops in 9-dev windows platform on Jan 26
erikj
parents:
28600
diff
changeset
|
101 |
|
380f123263d8
8071651: infinite build loops in 9-dev windows platform on Jan 26
erikj
parents:
28600
diff
changeset
|
102 |
ifeq ($(call equals, $(EQUALS_VALUE1), $(EQUALS_VALUE1)), ) |
380f123263d8
8071651: infinite build loops in 9-dev windows platform on Jan 26
erikj
parents:
28600
diff
changeset
|
103 |
$(error The strings >$(EQUALS_VALUE1)< and >$(EQUALS_VALUE1)< are not equal) |
380f123263d8
8071651: infinite build loops in 9-dev windows platform on Jan 26
erikj
parents:
28600
diff
changeset
|
104 |
endif |
380f123263d8
8071651: infinite build loops in 9-dev windows platform on Jan 26
erikj
parents:
28600
diff
changeset
|
105 |
|
52186
0dac3131b0fd
8212587: equals in MakeBase does not handle empty strings correctly
ihse
parents:
47334
diff
changeset
|
106 |
ifeq ($(call equals, $(EQUALS_EMPTY), $(EQUALS_EMPTY)), ) |
0dac3131b0fd
8212587: equals in MakeBase does not handle empty strings correctly
ihse
parents:
47334
diff
changeset
|
107 |
$(error The strings >$(EQUALS_EMPTY)< and >$(EQUALS_EMPTY)< are not equal) |
0dac3131b0fd
8212587: equals in MakeBase does not handle empty strings correctly
ihse
parents:
47334
diff
changeset
|
108 |
endif |
0dac3131b0fd
8212587: equals in MakeBase does not handle empty strings correctly
ihse
parents:
47334
diff
changeset
|
109 |
|
0dac3131b0fd
8212587: equals in MakeBase does not handle empty strings correctly
ihse
parents:
47334
diff
changeset
|
110 |
ifneq ($(call equals, $(EQUALS_EMPTY), $(EQUALS_VALUE2)), ) |
0dac3131b0fd
8212587: equals in MakeBase does not handle empty strings correctly
ihse
parents:
47334
diff
changeset
|
111 |
$(error The strings >$(EQUALS_EMPTY)< and >$(EQUALS_VALUE2)< are equal) |
0dac3131b0fd
8212587: equals in MakeBase does not handle empty strings correctly
ihse
parents:
47334
diff
changeset
|
112 |
endif |
0dac3131b0fd
8212587: equals in MakeBase does not handle empty strings correctly
ihse
parents:
47334
diff
changeset
|
113 |
|
0dac3131b0fd
8212587: equals in MakeBase does not handle empty strings correctly
ihse
parents:
47334
diff
changeset
|
114 |
ifneq ($(call equals, $(EQUALS_VALUE2), $(EQUALS_EMPTY)), ) |
0dac3131b0fd
8212587: equals in MakeBase does not handle empty strings correctly
ihse
parents:
47334
diff
changeset
|
115 |
$(error The strings >$(EQUALS_VALUE2)< and >$(EQUALS_EMPTY)< are equal) |
0dac3131b0fd
8212587: equals in MakeBase does not handle empty strings correctly
ihse
parents:
47334
diff
changeset
|
116 |
endif |
0dac3131b0fd
8212587: equals in MakeBase does not handle empty strings correctly
ihse
parents:
47334
diff
changeset
|
117 |
|
28607
380f123263d8
8071651: infinite build loops in 9-dev windows platform on Jan 26
erikj
parents:
28600
diff
changeset
|
118 |
################################################################################ |
53683 | 119 |
# Test boolean operators |
120 |
||
121 |
$(eval $(call assert-equals, $(call And, true true true ), true)) |
|
122 |
$(eval $(call assert-equals, $(call And, true false true ), false)) |
|
123 |
$(eval $(call assert-equals, $(call And, false false false ), false)) |
|
124 |
$(eval $(call assert-equals, $(call And, true), true)) |
|
125 |
$(eval $(call assert-equals, $(call And, false), false)) |
|
126 |
$(eval $(call assert-equals, $(call And, ), true)) |
|
127 |
||
128 |
$(eval $(call assert-equals, $(call Or, true true true ), true)) |
|
129 |
$(eval $(call assert-equals, $(call Or, true false true ), true)) |
|
130 |
$(eval $(call assert-equals, $(call Or, false false false ), false)) |
|
131 |
$(eval $(call assert-equals, $(call Or, true), true)) |
|
132 |
$(eval $(call assert-equals, $(call Or, false), false)) |
|
133 |
$(eval $(call assert-equals, $(call Or, ), false)) |
|
134 |
||
135 |
# We cannot catch $(error) while testing, but you can enable this manually |
|
136 |
# by uncommenting and watch make fails. |
|
137 |
#$(eval $(call assert-equals, $(call And, non-boolean ), $(error ...))) |
|
138 |
#$(eval $(call assert-equals, $(call Or, non-boolean ), $(error ...))) |
|
139 |
||
140 |
################################################################################ |
|
30095
0034766ccb09
8079344: Allow custom or platform specific java source to automatically override shared source
erikj
parents:
29312
diff
changeset
|
141 |
# Test remove-prefixes |
0034766ccb09
8079344: Allow custom or platform specific java source to automatically override shared source
erikj
parents:
29312
diff
changeset
|
142 |
|
54380 | 143 |
$(call AssertEquals, \ |
30095
0034766ccb09
8079344: Allow custom or platform specific java source to automatically override shared source
erikj
parents:
29312
diff
changeset
|
144 |
$(call remove-prefixes, pre, prefix postfix), fix postfix, \ |
54380 | 145 |
Prefixes not properly removed) |
30095
0034766ccb09
8079344: Allow custom or platform specific java source to automatically override shared source
erikj
parents:
29312
diff
changeset
|
146 |
|
54380 | 147 |
$(call AssertEquals, \ |
30095
0034766ccb09
8079344: Allow custom or platform specific java source to automatically override shared source
erikj
parents:
29312
diff
changeset
|
148 |
$(call remove-prefixes, pre post, prefix postfix), fix fix, \ |
54380 | 149 |
Prefixes not properly removed) |
30095
0034766ccb09
8079344: Allow custom or platform specific java source to automatically override shared source
erikj
parents:
29312
diff
changeset
|
150 |
|
0034766ccb09
8079344: Allow custom or platform specific java source to automatically override shared source
erikj
parents:
29312
diff
changeset
|
151 |
################################################################################ |
28600
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
152 |
# Test ShellQuote |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
153 |
|
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
154 |
SHELL_QUOTE_VALUE := foo '""' "''" bar |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
155 |
SHELL_QUOTE_RESULT := $(shell $(ECHO) $(call ShellQuote, \ |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
156 |
$(SHELL_QUOTE_VALUE))) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
157 |
|
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
158 |
ifneq ($(SHELL_QUOTE_VALUE), $(SHELL_QUOTE_RESULT)) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
159 |
$(error Expected: >$(SHELL_QUOTE_VALUE)< - Result: >$(SHELL_QUOTE_RESULT)<) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
160 |
endif |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
161 |
|
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
162 |
################################################################################ |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
163 |
# Test read and write to file |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
164 |
|
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
165 |
READ_WRITE_FILE := $(OUTPUT_DIR)/read-write |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
166 |
READ_WRITE_VALUE := foo '""' "''" \t\n\\ bar |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
167 |
$(call WriteFile, $(READ_WRITE_VALUE), $(READ_WRITE_FILE)) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
168 |
READ_WRITE_RESULT := $(call ReadFile, $(READ_WRITE_FILE)) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
169 |
|
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
170 |
ifneq ($(READ_WRITE_VALUE), $(READ_WRITE_RESULT)) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
171 |
$(error Expected: >$(READ_WRITE_VALUE)< - Result: >$(READ_WRITE_RESULT)<) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
172 |
endif |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
173 |
|
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
174 |
################################################################################ |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
175 |
# Test creating dependencies on make variables |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
176 |
|
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
177 |
VARDEP_DIR := $(OUTPUT_DIR)/vardep |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
178 |
VARDEP_SRC_FILE := $(VARDEP_DIR)/src-file |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
179 |
VARDEP_TARGET_FILE := $(VARDEP_DIR)/target-file |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
180 |
VARDEP_FLAG_FILE := $(VARDEP_DIR)/flag-file |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
181 |
|
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
182 |
$(VARDEP_DIR)/src-file: |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
183 |
$(MKDIR) -p $(@D) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
184 |
$(ECHO) "some string XXX" > $@ |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
185 |
|
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
186 |
$(VARDEP_TARGET_FILE): $(VARDEP_DIR)/src-file \ |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
187 |
$(call DependOnVariable, VARDEP_TEST_VAR) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
188 |
$(MKDIR) -p $(@D) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
189 |
$(SED) -e 's/XXX/$(VARDEP_TEST_VAR)/g' $< > $@ |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
190 |
$(TOUCH) $(VARDEP_FLAG_FILE) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
191 |
|
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
192 |
test-vardep: |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
193 |
$(RM) $(VARDEP_SRC_FILE) $(VARDEP_TARGET_FILE) $(VARDEP_FLAG_FILE) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
194 |
# |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
195 |
# Simply create the target file and verify that it has the correct value |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
196 |
# |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
197 |
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR=value1 $(VARDEP_TARGET_FILE) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
198 |
$(PRINTF) "Expecting value1: %s\n" "`$(CAT) $(VARDEP_DIR)/target-file`" |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
199 |
test "some string value1" = "`$(CAT) $(VARDEP_DIR)/target-file`" |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
200 |
test -e $(VARDEP_FLAG_FILE) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
201 |
# |
44027 | 202 |
# Make the target file again and verify that the value is updated with |
28600
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
203 |
# the new value |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
204 |
# |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
205 |
$(SLEEP_ON_MAC) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
206 |
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR=value2 $(VARDEP_TARGET_FILE) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
207 |
$(PRINTF) "Expecting value2: %s\n" "`$(CAT) $(VARDEP_DIR)/target-file`" |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
208 |
test "some string value2" = "`$(CAT) $(VARDEP_DIR)/target-file`" |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
209 |
test -e $(VARDEP_FLAG_FILE) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
210 |
# |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
211 |
# Make the target again with the same value and verify that the recipe |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
212 |
# was never run by checking that the flag file was not recreated |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
213 |
# |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
214 |
$(SLEEP_ON_MAC) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
215 |
$(RM) $(VARDEP_FLAG_FILE) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
216 |
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR=value2 $(VARDEP_TARGET_FILE) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
217 |
$(PRINTF) "Expecting value2: %s\n" "`$(CAT) $(VARDEP_DIR)/target-file`" |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
218 |
test "some string value2" = "`$(CAT) $(VARDEP_DIR)/target-file`" |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
219 |
test ! -e $(VARDEP_FLAG_FILE) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
220 |
# |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
221 |
# Test running with spaces at the end and the middle of the value |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
222 |
# and verify that the file isn't rewritten the second time |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
223 |
# |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
224 |
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR="value3 foo " $(VARDEP_TARGET_FILE) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
225 |
$(RM) $(VARDEP_FLAG_FILE) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
226 |
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR="value3 foo" $(VARDEP_TARGET_FILE) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
227 |
test ! -e $(VARDEP_FLAG_FILE) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
228 |
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR=" value3 foo" $(VARDEP_TARGET_FILE) |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
229 |
test ! -e $(VARDEP_FLAG_FILE) |
33054
bcb9f5ea5761
8140484: Vardeps broken when variable value contains '$'
erikj
parents:
32807
diff
changeset
|
230 |
# |
bcb9f5ea5761
8140484: Vardeps broken when variable value contains '$'
erikj
parents:
32807
diff
changeset
|
231 |
# Test including some problematic characters |
41875 | 232 |
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR='value4 \$$ORIGIN' $(VARDEP_TARGET_FILE) |
33054
bcb9f5ea5761
8140484: Vardeps broken when variable value contains '$'
erikj
parents:
32807
diff
changeset
|
233 |
$(RM) $(VARDEP_FLAG_FILE) |
41875 | 234 |
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR='value4 \$$ORIGIN' $(VARDEP_TARGET_FILE) |
33054
bcb9f5ea5761
8140484: Vardeps broken when variable value contains '$'
erikj
parents:
32807
diff
changeset
|
235 |
test ! -e $(VARDEP_FLAG_FILE) |
28600
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
236 |
|
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
237 |
# Test specifying a specific value file to store variable in |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
238 |
VARDEP_VALUE_FILE := $(VARDEP_DIR)/value-file |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
239 |
VARDEP_TEST_VAR2 := value3 |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
240 |
|
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
241 |
VARDEP_RETURN_VALUE := $(call DependOnVariable, VARDEP_TEST_VAR2, $(VARDEP_VALUE_FILE)) |
54380 | 242 |
$(call AssertEquals, $(VARDEP_RETURN_VALUE), $(VARDEP_VALUE_FILE), \ |
243 |
Wrong filename returned) |
|
33054
bcb9f5ea5761
8140484: Vardeps broken when variable value contains '$'
erikj
parents:
32807
diff
changeset
|
244 |
-include $(VARDEP_VALUE_FILE) |
54380 | 245 |
$(call AssertEquals, $(VARDEP_TEST_VAR2_old), $(VARDEP_TEST_VAR2), \ |
246 |
Wrong contents in vardeps file) |
|
28600
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
247 |
|
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
248 |
# Test with a variable value containing some problematic characters |
42134
bbcdb49521b1
8169860: Clean up and unify the refactored Javadoc generation
ihse
parents:
41875
diff
changeset
|
249 |
VARDEP_TEST_VAR3 := foo '""' "''" bar \$$ORIGIN &\#x00a9 |
28600
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
250 |
VARDEP_VALUE_FILE := $(call DependOnVariable, VARDEP_TEST_VAR3) |
33054
bcb9f5ea5761
8140484: Vardeps broken when variable value contains '$'
erikj
parents:
32807
diff
changeset
|
251 |
-include $(VARDEP_VALUE_FILE) |
54380 | 252 |
$(call AssertEquals, $(call EscapeHash,$(VARDEP_TEST_VAR3_old)), \ |
42134
bbcdb49521b1
8169860: Clean up and unify the refactored Javadoc generation
ihse
parents:
41875
diff
changeset
|
253 |
$(call EscapeHash,$(VARDEP_TEST_VAR3)), \ |
54380 | 254 |
Wrong contents in vardep file) |
28600
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
255 |
|
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
256 |
TEST_TARGETS += test-vardep |
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
257 |
|
09dd1740f176
8069261: Create make dependencies on make variable values
erikj
parents:
25854
diff
changeset
|
258 |
################################################################################ |
29312
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
259 |
# Test sequence |
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
260 |
|
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
261 |
ifneq ($(call sequence, 1, 1), 1) |
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
262 |
$(error Sequence 1, 1 should be "1", but was $(call sequence, 1, 1)) |
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
263 |
endif |
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
264 |
|
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
265 |
ifneq ($(call sequence, 2, 3), 2 3) |
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
266 |
$(error Sequence 2, 3 should be "2 3", but was $(call sequence, 2, 3)) |
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
267 |
endif |
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
268 |
|
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
269 |
ifneq ($(call sequence, 4, 9), 4 5 6 7 8 9) |
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
270 |
$(error Sequence 4, 9 should be "4 5 6 7 8 9", but was $(call sequence, 4, 9)) |
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
271 |
endif |
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
272 |
|
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
273 |
ifneq ($(call sequence, 5, 15), 5 6 7 8 9 10 11 12 13 14 15) |
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
274 |
$(error Sequence 5, 15 should be "5 6 7 8 9 10 11 12 13 14 15", \ |
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
275 |
but was $(call sequence, 5, 15)) |
f3f859137ce6
8074988: Reduce boilerplate in Setup* macro definitions
erikj
parents:
28607
diff
changeset
|
276 |
endif |
25854 | 277 |
|
37030 | 278 |
################################################################################ |
279 |
# Test that PathList is safe when called multiple nested times. |
|
280 |
||
281 |
PATHLIST_INPUT := foo bar baz |
|
282 |
||
54380 | 283 |
$(call AssertEquals, \ |
37030 | 284 |
$(call PathList, $(call PathList, $(PATHLIST_INPUT))), \ |
285 |
$(call PathList, $(PATHLIST_INPUT)), \ |
|
54380 | 286 |
PathList call not safe for calling twice, \ |
287 |
) |
|
37030 | 288 |
|
41260 | 289 |
################################################################################ |
290 |
# Test FindCommonPathPrefix |
|
291 |
||
54380 | 292 |
$(call AssertEquals, \ |
41260 | 293 |
$(call FindCommonPathPrefix, /foo/bar/baz, /foo/bar/banan), \ |
294 |
/foo/bar, \ |
|
295 |
FindCommonPathPrefix, \ |
|
54380 | 296 |
) |
41260 | 297 |
|
54380 | 298 |
$(call AssertEquals, \ |
41260 | 299 |
$(call FindCommonPathPrefix, /foo/bar/baz, /foo/bar), \ |
300 |
/foo/bar, \ |
|
301 |
FindCommonPathPrefix, \ |
|
54380 | 302 |
) |
41260 | 303 |
|
54380 | 304 |
$(call AssertEquals, \ |
41260 | 305 |
$(call FindCommonPathPrefix, /foo/bar/baz, /foo/bar/), \ |
306 |
/foo/bar, \ |
|
307 |
FindCommonPathPrefix, \ |
|
54380 | 308 |
) |
41260 | 309 |
|
54380 | 310 |
$(call AssertEquals, \ |
41260 | 311 |
$(call FindCommonPathPrefix, foo/bar/baz, foo/bar/banan), \ |
312 |
foo/bar, \ |
|
313 |
FindCommonPathPrefix, \ |
|
54380 | 314 |
) |
41260 | 315 |
|
54380 | 316 |
$(call AssertEquals, \ |
41260 | 317 |
$(call FindCommonPathPrefix, foo/bar/baz, /foo/bar/banan), \ |
318 |
, \ |
|
319 |
FindCommonPathPrefix, \ |
|
54380 | 320 |
) |
41260 | 321 |
|
322 |
################################################################################ |
|
323 |
# DirToDotDot |
|
324 |
||
54380 | 325 |
$(call AssertEquals, \ |
41260 | 326 |
$(call DirToDotDot, foo/bar/baz/), \ |
327 |
../../.., \ |
|
328 |
DirToDotDot, \ |
|
54380 | 329 |
) |
41260 | 330 |
|
54380 | 331 |
$(call AssertEquals, \ |
41260 | 332 |
$(call DirToDotDot, foo/bar), \ |
333 |
../.., \ |
|
334 |
DirToDotDot, \ |
|
54380 | 335 |
) |
41260 | 336 |
|
54380 | 337 |
$(call AssertEquals, \ |
41260 | 338 |
$(call DirToDotDot, /foo), \ |
339 |
.., \ |
|
340 |
DirToDotDot, \ |
|
54380 | 341 |
) |
41260 | 342 |
|
343 |
################################################################################ |
|
344 |
# RelativePath |
|
345 |
||
54380 | 346 |
$(call AssertEquals, \ |
41260 | 347 |
$(call RelativePath, foo/bar/baz, foo/bar/banan), \ |
348 |
../baz, \ |
|
349 |
RelativePath, \ |
|
54380 | 350 |
) |
41260 | 351 |
|
54380 | 352 |
$(call AssertEquals, \ |
41260 | 353 |
$(call RelativePath, foo/bar/baz/banan/kung, foo/bar/banan/kung), \ |
354 |
../../baz/banan/kung, \ |
|
355 |
RelativePath, \ |
|
54380 | 356 |
) |
41260 | 357 |
|
54380 | 358 |
$(call AssertEquals, \ |
41260 | 359 |
$(call RelativePath, /foo/bar/baz/banan/kung, /foo/bar/banan/kung/), \ |
360 |
../../baz/banan/kung, \ |
|
361 |
RelativePath, \ |
|
54380 | 362 |
) |
41260 | 363 |
|
364 |
################################################################################ |
|
44027 | 365 |
# Test ParseKeywordVariable |
366 |
||
367 |
KWBASE := APA=banan;GURKA=tomat;COUNT=1%202%203%204%205;SUM=1+2+3+4+5;MANY_WORDS=I have the best words. |
|
368 |
||
369 |
$(eval $(call ParseKeywordVariable, KWBASE, \ |
|
52342 | 370 |
SINGLE_KEYWORDS := APA GURKA SUM, \ |
44027 | 371 |
STRING_KEYWORDS := COUNT MANY_WORDS, \ |
372 |
)) |
|
373 |
||
54380 | 374 |
$(call AssertEquals, \ |
44027 | 375 |
$(KWBASE_APA), \ |
376 |
banan, \ |
|
377 |
ParseKeywordVariable failed to parse APA, \ |
|
54380 | 378 |
) |
44027 | 379 |
|
54380 | 380 |
$(call AssertEquals, \ |
44027 | 381 |
$(KWBASE_COUNT), \ |
382 |
1 2 3 4 5, \ |
|
383 |
ParseKeywordVariable failed to parse COUNT, \ |
|
54380 | 384 |
) |
44027 | 385 |
|
54380 | 386 |
$(call AssertEquals, \ |
44027 | 387 |
$(KWBASE_SUM), \ |
388 |
1+2+3+4+5, \ |
|
389 |
ParseKeywordVariable failed to parse SUM, \ |
|
54380 | 390 |
) |
44027 | 391 |
|
54380 | 392 |
$(call AssertEquals, \ |
44027 | 393 |
$(KWBASE_MANY_WORDS), \ |
394 |
I have the best words., \ |
|
395 |
ParseKeywordVariable failed to parse MANY_WORDS, \ |
|
54380 | 396 |
) |
44027 | 397 |
|
398 |
# Simulate variable set from command line by using "override" |
|
399 |
override KWBASE_WEIRD_GURKA := paprika |
|
400 |
KWBASE_WEIRD := ;;APA=banan;;;GURKA=apelsin;APA=skansen;; |
|
401 |
||
402 |
$(eval $(call ParseKeywordVariable, KWBASE_WEIRD, \ |
|
52342 | 403 |
SINGLE_KEYWORDS := APA GURKA SUM, \ |
44027 | 404 |
STRING_KEYWORDS := COUNT, \ |
405 |
)) |
|
406 |
||
54380 | 407 |
$(call AssertEquals, \ |
44027 | 408 |
$(KWBASE_WEIRD_APA), \ |
409 |
skansen, \ |
|
410 |
ParseKeywordVariable failed to overwrite APA, \ |
|
54380 | 411 |
) |
44027 | 412 |
|
54380 | 413 |
$(call AssertEquals, \ |
44027 | 414 |
$(KWBASE_WEIRD_GURKA), \ |
415 |
paprika, \ |
|
416 |
ParseKeywordVariable failed to preserve GURKA, \ |
|
54380 | 417 |
) |
418 |
||
419 |
################################################################################ |
|
420 |
# Test recursive wildcard |
|
421 |
||
422 |
A_FOOBAR := $(OUTPUT_DIR)/wildcard/a/foo.bar |
|
423 |
A_B_DOOBAR := $(OUTPUT_DIR)/wildcard/a/b/doo.bar |
|
424 |
A_B_FOOBAR := $(OUTPUT_DIR)/wildcard/a/b/foo.bar |
|
425 |
A_B_FOOBAZ := $(OUTPUT_DIR)/wildcard/a/b/foo.baz |
|
426 |
X_Y_FOOBAR := $(OUTPUT_DIR)/wildcard/x/y/foo.bar |
|
427 |
X_Y_FOOBAZ := $(OUTPUT_DIR)/wildcard/x/y/foo.baz |
|
428 |
X_Y_FOODOLLAR := $(OUTPUT_DIR)/wildcard/x/y/foo$$foo |
|
429 |
||
430 |
$(call MakeDir, $(OUTPUT_DIR)/wildcard/a/b) |
|
431 |
$(call MakeDir, $(OUTPUT_DIR)/wildcard/x/y) |
|
432 |
$(shell $(TOUCH) $(A_FOOBAR) $(A_B_FOOBAR) $(A_B_DOOBAR) $(A_B_FOOBAZ) \ |
|
433 |
$(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(call ShellQuote, $(X_Y_FOODOLLAR))) |
|
434 |
||
435 |
ifeq ($(RWILDCARD_WORKS), true) |
|
436 |
$(call AssertEquals, \ |
|
437 |
$(sort $(call rwildcard, $(OUTPUT_DIR)/wildcard, *.bar)), \ |
|
438 |
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_FOOBAR) $(X_Y_FOOBAR)), \ |
|
439 |
Wrong files returned from rwildcard, \ |
|
440 |
) |
|
441 |
||
442 |
$(call AssertEquals, \ |
|
443 |
$(sort $(call rwildcard, $(OUTPUT_DIR)/wildcard, doo.*)), \ |
|
444 |
$(A_B_DOOBAR), \ |
|
445 |
Wrong files returned from rwildcard, \ |
|
446 |
) |
|
447 |
||
448 |
$(call AssertEquals, \ |
|
449 |
$(sort $(call rwildcard, $(OUTPUT_DIR)/wildcard, *.bar *.baz)), \ |
|
450 |
$(sort $(A_B_DOOBAR) $(A_FOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \ |
|
451 |
$(X_Y_FOOBAR) $(X_Y_FOOBAZ)), \ |
|
452 |
Wrong files returned from rwildcard, \ |
|
453 |
) |
|
454 |
||
455 |
$(call AssertEquals, \ |
|
456 |
$(sort $(call WildcardFindFiles, $(OUTPUT_DIR)/wildcard)), \ |
|
457 |
$(sort $(A_B_DOOBAR) $(A_FOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \ |
|
458 |
$(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \ |
|
459 |
Wrong files returned from WildcardFindFiles, \ |
|
460 |
) |
|
461 |
||
462 |
$(call AssertEquals, \ |
|
463 |
$(sort $(call WildcardFindFiles, $(OUTPUT_DIR)/wildcard/x/y)), \ |
|
464 |
$(sort $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \ |
|
465 |
Wrong files returned from WildcardFindFiles, \ |
|
466 |
) |
|
467 |
||
468 |
$(call AssertEquals, \ |
|
469 |
$(sort $(call WildcardFindFiles, $(OUTPUT_DIR)/wildcard/a/b $(OUTPUT_DIR)/wildcard/x)), \ |
|
470 |
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \ |
|
471 |
$(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \ |
|
472 |
Wrong files returned from WildcardFindFiles, \ |
|
473 |
) |
|
474 |
endif |
|
475 |
||
476 |
$(call AssertEquals, \ |
|
477 |
$(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard)), \ |
|
478 |
$(sort $(A_B_DOOBAR) $(A_FOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \ |
|
479 |
$(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \ |
|
480 |
Wrong files returned from ShellFindFiles, \ |
|
481 |
) |
|
482 |
||
483 |
$(call AssertEquals, \ |
|
484 |
$(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard/x/y)), \ |
|
485 |
$(sort $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \ |
|
486 |
Wrong files returned from ShellFindFiles, \ |
|
487 |
) |
|
488 |
||
489 |
$(call AssertEquals, \ |
|
490 |
$(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard/a/b $(OUTPUT_DIR)/wildcard/x)), \ |
|
491 |
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \ |
|
492 |
$(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \ |
|
493 |
Wrong files returned from ShellFindFiles, \ |
|
494 |
) |
|
495 |
||
496 |
$(call AssertEquals, \ |
|
497 |
$(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard, *.bar)), \ |
|
498 |
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_FOOBAR) $(X_Y_FOOBAR)), \ |
|
499 |
Wrong files returned from ShellFindFiles, \ |
|
500 |
) |
|
501 |
||
502 |
$(call AssertEquals, \ |
|
503 |
$(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard, doo.*)), \ |
|
504 |
$(A_B_DOOBAR), \ |
|
505 |
Wrong files returned from ShellFindFiles, \ |
|
506 |
) |
|
507 |
||
508 |
$(call AssertEquals, \ |
|
509 |
$(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard, *.bar *.baz)), \ |
|
510 |
$(sort $(A_B_DOOBAR) $(A_FOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \ |
|
511 |
$(X_Y_FOOBAR) $(X_Y_FOOBAZ)), \ |
|
512 |
Wrong files returned from ShellFindFiles, \ |
|
513 |
) |
|
514 |
||
515 |
################################################################################ |
|
516 |
||
517 |
$(call AssertEquals, \ |
|
518 |
$(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/a/b)), \ |
|
519 |
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ)), \ |
|
520 |
CacheFindFiles test 1, \ |
|
521 |
) |
|
522 |
$(call FillFindCache, $(OUTPUT_DIR)/wildcard/a/b) |
|
523 |
$(call AssertEquals, \ |
|
524 |
$(CacheFindFiles_CACHED_DIRS), $(OUTPUT_DIR)/wildcard/a/b, \ |
|
525 |
Wrong files in find cache dirs, \ |
|
526 |
) |
|
527 |
$(call AssertEquals, \ |
|
528 |
$(sort $(CacheFindFiles_CACHED_FILES)), \ |
|
529 |
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ)), \ |
|
530 |
Wrong files in find cache files, \ |
|
531 |
) |
|
532 |
$(call AssertEquals, \ |
|
533 |
$(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/a/b)), \ |
|
534 |
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ)), \ |
|
535 |
CacheFindFiles test 1, \ |
|
536 |
) |
|
537 |
||
538 |
$(call AssertEquals, \ |
|
539 |
$(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/a)), \ |
|
540 |
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) $(A_FOOBAR)), \ |
|
541 |
CacheFindFiles test 2, \ |
|
542 |
) |
|
543 |
$(call FillFindCache, $(OUTPUT_DIR)/wildcard/a) |
|
544 |
$(call AssertEquals, \ |
|
545 |
$(CacheFindFiles_CACHED_DIRS), \ |
|
546 |
$(OUTPUT_DIR)/wildcard/a/b $(OUTPUT_DIR)/wildcard/a, \ |
|
547 |
Wrong files in find cache dirs, \ |
|
548 |
) |
|
549 |
$(call AssertEquals, \ |
|
550 |
$(sort $(CacheFindFiles_CACHED_FILES)), \ |
|
551 |
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) $(A_FOOBAR)), \ |
|
552 |
Wrong files in find cache files, \ |
|
553 |
) |
|
554 |
$(call AssertEquals, \ |
|
555 |
$(words $(CacheFindFiles_CACHED_FILES)), 4, \ |
|
556 |
Wrong files in find cache files >$(CacheFindFiles_CACHED_FILES)<, \ |
|
557 |
) |
|
558 |
$(call AssertEquals, \ |
|
559 |
$(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/a)), \ |
|
560 |
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) $(A_FOOBAR)), \ |
|
561 |
CacheFindFiles test 2, \ |
|
562 |
) |
|
563 |
||
564 |
$(call AssertEquals, \ |
|
565 |
$(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/x)), \ |
|
566 |
$(sort $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \ |
|
567 |
CacheFindFiles test 3, \ |
|
568 |
) |
|
569 |
$(call FillFindCache, $(OUTPUT_DIR)/wildcard/x) |
|
570 |
$(call AssertEquals, \ |
|
571 |
$(CacheFindFiles_CACHED_DIRS), \ |
|
572 |
$(OUTPUT_DIR)/wildcard/a/b $(OUTPUT_DIR)/wildcard/a $(OUTPUT_DIR)/wildcard/x, \ |
|
573 |
Wrong files in find cache dirs, \ |
|
574 |
) |
|
575 |
$(call AssertEquals, \ |
|
576 |
$(sort $(CacheFindFiles_CACHED_FILES)), \ |
|
577 |
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) $(A_FOOBAR) \ |
|
578 |
$(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \ |
|
579 |
Wrong files in find cache files, \ |
|
580 |
) |
|
581 |
$(call AssertEquals, \ |
|
582 |
$(words $(CacheFindFiles_CACHED_FILES)), 7, \ |
|
583 |
Wrong files in find cache files, \ |
|
584 |
) |
|
585 |
$(call AssertEquals, \ |
|
586 |
$(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/x)), \ |
|
587 |
$(sort $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \ |
|
588 |
CacheFindFiles test 3, \ |
|
589 |
) |
|
590 |
||
591 |
$(call AssertEquals, \ |
|
592 |
$(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/x/y)), \ |
|
593 |
$(sort $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \ |
|
594 |
CacheFindFiles test 4, \ |
|
595 |
) |
|
596 |
$(call FillFindCache, $(OUTPUT_DIR)/wildcard/x/y) |
|
597 |
$(call AssertEquals, \ |
|
598 |
$(CacheFindFiles_CACHED_DIRS), \ |
|
599 |
$(OUTPUT_DIR)/wildcard/a/b $(OUTPUT_DIR)/wildcard/a $(OUTPUT_DIR)/wildcard/x, \ |
|
600 |
Wrong files in find cache dirs, \ |
|
601 |
) |
|
602 |
$(call AssertEquals, \ |
|
603 |
$(sort $(CacheFindFiles_CACHED_FILES)), \ |
|
604 |
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) $(A_FOOBAR) \ |
|
605 |
$(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \ |
|
606 |
Wrong files in find cache files, \ |
|
607 |
) |
|
608 |
$(call AssertEquals, \ |
|
609 |
$(words $(CacheFindFiles_CACHED_FILES)), 7, \ |
|
610 |
Wrong files in find cache files, \ |
|
611 |
) |
|
44027 | 612 |
|
613 |
################################################################################ |
|
41260 | 614 |
|
25854 | 615 |
all: $(TEST_TARGETS) |