2
# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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.
9
# This code is distributed in the hope that it will be useful, but WITHOUT
10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
# version 2 for more details (a copy is included in the LICENSE file that
13
# accompanied this code).
15
# You should have received a copy of the GNU General Public License version
16
# 2 along with this work; if not, write to the Free Software Foundation,
17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
# or visit www.oracle.com if you need additional information or have any
28
include UtilsForTests.gmk
30
THIS_FILE := $(TOPDIR)/test/make/TestMakeBase.gmk
32
$(TOPDIR)/make/common/MakeBase.gmk \
35
OUTPUT_DIR := $(TESTMAKE_OUTPUTDIR)/make-base
36
$(call MakeDir, $(OUTPUT_DIR))
38
################################################################################
40
ifneq ($(call EscapeDollar, foo$$bar), foo\$$bar)
41
$(error EscapeDollar failed $(call EscapeDollar, foo$$bar) foo\$$bar)
44
ESCAPE_DOLLAR_DIR := $(OUTPUT_DIR)/escape-dollar
46
$(ESCAPE_DOLLAR_DIR)/_escape_dollar: $(DEPS)
49
$(ECHO) foo\$$bar > $(@D)/file1
50
$(ECHO) $(call EscapeDollar, foo$$bar) > $(@D)/file2
51
$(ECHO) $(call EscapeDollar, foo\$$bar) > $(@D)/file3
52
$(DIFF) $(@D)/file1 $(@D)/file2
53
$(DIFF) $(@D)/file1 $(@D)/file3
56
TEST_TARGETS += $(ESCAPE_DOLLAR_DIR)/_escape_dollar
58
################################################################################
59
# Test containing and not-containing
61
CONT_LIST := foo bar baz foobar foobaz
63
# Param 1 - string to look for
64
# Param 2 - expected result
66
value := $$(call containing, $1, $(CONT_LIST))
68
$$(info (call containing, $1, $(CONT_LIST)))
69
$$(error result >$$(value)<, expected >$2<)
73
$(eval $(call TestContaining,bar,bar foobar))
74
$(eval $(call TestContaining,foo bar,foo bar foobar foobaz))
76
# Param 1 - string to look for
77
# Param 2 - expected result
78
define TestNotContaining
79
value := $$(call not-containing, $1, $(CONT_LIST))
81
$$(info (call not-containing, $1, $(CONT_LIST)))
82
$$(error result >$$(value)<, expected >$2<)
86
$(eval $(call TestNotContaining,bar,foo baz foobaz))
87
$(eval $(call TestNotContaining,foo bar,baz))
89
################################################################################
92
EQUALS_VALUE1 := value1$(SPACE)
93
EQUALS_VALUE2 := value2
96
ifneq ($(call equals, $(EQUALS_VALUE1), $(EQUALS_VALUE2)), )
97
$(error The strings >$(EQUALS_VALUE1)< and >$(EQUALS_VALUE2)< are equal)
100
ifeq ($(call equals, $(EQUALS_VALUE1), $(EQUALS_VALUE1)), )
101
$(error The strings >$(EQUALS_VALUE1)< and >$(EQUALS_VALUE1)< are not equal)
104
ifeq ($(call equals, $(EQUALS_EMPTY), $(EQUALS_EMPTY)), )
105
$(error The strings >$(EQUALS_EMPTY)< and >$(EQUALS_EMPTY)< are not equal)
108
ifneq ($(call equals, $(EQUALS_EMPTY), $(EQUALS_VALUE2)), )
109
$(error The strings >$(EQUALS_EMPTY)< and >$(EQUALS_VALUE2)< are equal)
112
ifneq ($(call equals, $(EQUALS_VALUE2), $(EQUALS_EMPTY)), )
113
$(error The strings >$(EQUALS_VALUE2)< and >$(EQUALS_EMPTY)< are equal)
116
################################################################################
117
# Test boolean operators
119
$(eval $(call assert-equals, $(call And, true true true ), true))
120
$(eval $(call assert-equals, $(call And, true false true ), false))
121
$(eval $(call assert-equals, $(call And, false false false ), false))
122
$(eval $(call assert-equals, $(call And, true), true))
123
$(eval $(call assert-equals, $(call And, false), false))
124
$(eval $(call assert-equals, $(call And, ), true))
126
$(eval $(call assert-equals, $(call Or, true true true ), true))
127
$(eval $(call assert-equals, $(call Or, true false true ), true))
128
$(eval $(call assert-equals, $(call Or, false false false ), false))
129
$(eval $(call assert-equals, $(call Or, true), true))
130
$(eval $(call assert-equals, $(call Or, false), false))
131
$(eval $(call assert-equals, $(call Or, ), false))
133
# We cannot catch $(error) while testing, but you can enable this manually
134
# by uncommenting and watch make fails.
135
#$(eval $(call assert-equals, $(call And, non-boolean ), $(error ...)))
136
#$(eval $(call assert-equals, $(call Or, non-boolean ), $(error ...)))
138
################################################################################
139
# Test remove-prefixes
141
$(call AssertEquals, \
142
$(call remove-prefixes, pre, prefix postfix), fix postfix, \
143
Prefixes not properly removed)
145
$(call AssertEquals, \
146
$(call remove-prefixes, pre post, prefix postfix), fix fix, \
147
Prefixes not properly removed)
149
################################################################################
152
SHELL_QUOTE_VALUE := foo '""' "''" bar
153
SHELL_QUOTE_RESULT := $(shell $(ECHO) $(call ShellQuote, \
154
$(SHELL_QUOTE_VALUE)))
156
ifneq ($(SHELL_QUOTE_VALUE), $(SHELL_QUOTE_RESULT))
157
$(error Expected: >$(SHELL_QUOTE_VALUE)< - Result: >$(SHELL_QUOTE_RESULT)<)
160
################################################################################
161
# Test read and write to file
163
READ_WRITE_FILE := $(OUTPUT_DIR)/read-write
164
READ_WRITE_VALUE := foo '""' "''" \t\n\\ bar
165
$(call WriteFile, $(READ_WRITE_VALUE), $(READ_WRITE_FILE))
166
READ_WRITE_RESULT := $(call ReadFile, $(READ_WRITE_FILE))
168
ifneq ($(READ_WRITE_VALUE), $(READ_WRITE_RESULT))
169
$(error Expected: >$(READ_WRITE_VALUE)< - Result: >$(READ_WRITE_RESULT)<)
173
TEST_STRING_2 := 1234$(NEWLINE)
174
TEST_STRING_3 := 1234$(NEWLINE)$(NEWLINE)
176
# Writing a string ending in newline should not add a newline, but if it does
177
# not, a newline should be added. We check this by verifying that the size of the
178
# file is 5 characters for both test strings.
179
TEST_FILE_1 := $(OUTPUT_DIR)/write-file-1
180
TEST_FILE_2 := $(OUTPUT_DIR)/write-file-2
181
TEST_FILE_3 := $(OUTPUT_DIR)/write-file-3
183
$(call WriteFile, $(TEST_STRING_1), $(TEST_FILE_1))
184
$(call WriteFile, $(TEST_STRING_2), $(TEST_FILE_2))
185
$(call WriteFile, $(TEST_STRING_3), $(TEST_FILE_3))
187
TEST_FILE_1_SIZE := $(strip $(shell $(WC) -c < $(TEST_FILE_1)))
188
TEST_FILE_2_SIZE := $(strip $(shell $(WC) -c < $(TEST_FILE_2)))
189
TEST_FILE_3_SIZE := $(strip $(shell $(WC) -c < $(TEST_FILE_3)))
191
ifneq ($(TEST_FILE_1_SIZE), 5)
192
$(error Expected file size 5 for WriteFile 1, got $(TEST_FILE_1_SIZE))
194
ifneq ($(TEST_FILE_2_SIZE), 5)
195
$(error Expected file size 5 for WriteFile 2, got $(TEST_FILE_2_SIZE))
197
ifneq ($(TEST_FILE_3_SIZE), 5)
198
$(error Expected file size 5 for WriteFile 3, got $(TEST_FILE_3_SIZE))
201
# Also test append (assumes WriteFile works as expected)
202
$(call WriteFile, $(TEST_STRING_1), $(TEST_FILE_1))
203
$(call AppendFile, $(TEST_STRING_1), $(TEST_FILE_1))
204
$(call AppendFile, $(TEST_STRING_1), $(TEST_FILE_1))
206
$(call WriteFile, $(TEST_STRING_2), $(TEST_FILE_2))
207
$(call AppendFile, $(TEST_STRING_2), $(TEST_FILE_2))
208
$(call AppendFile, $(TEST_STRING_2), $(TEST_FILE_2))
210
$(call WriteFile, $(TEST_STRING_3), $(TEST_FILE_3))
211
$(call AppendFile, $(TEST_STRING_3), $(TEST_FILE_3))
212
$(call AppendFile, $(TEST_STRING_3), $(TEST_FILE_3))
214
TEST_FILE_1_SIZE := $(strip $(shell $(WC) -c < $(TEST_FILE_1)))
215
TEST_FILE_2_SIZE := $(strip $(shell $(WC) -c < $(TEST_FILE_2)))
216
TEST_FILE_3_SIZE := $(strip $(shell $(WC) -c < $(TEST_FILE_3)))
218
ifneq ($(TEST_FILE_1_SIZE), 15)
219
$(error Expected file size 15 for AppendFile 1, got $(TEST_FILE_1_SIZE))
221
ifneq ($(TEST_FILE_2_SIZE), 15)
222
$(error Expected file size 15 for AppendFile 2, got $(TEST_FILE_2_SIZE))
224
ifneq ($(TEST_FILE_3_SIZE), 15)
225
$(error Expected file size 15 for AppendFile 3, got $(TEST_FILE_3_SIZE))
228
################################################################################
229
# Test creating dependencies on make variables
231
VARDEP_DIR := $(OUTPUT_DIR)/vardep
232
VARDEP_SRC_FILE := $(VARDEP_DIR)/src-file
233
VARDEP_TARGET_FILE := $(VARDEP_DIR)/target-file
234
VARDEP_FLAG_FILE := $(VARDEP_DIR)/flag-file
238
$(ECHO) "some string XXX" > $@
240
$(VARDEP_TARGET_FILE): $(VARDEP_SRC_FILE) \
241
$(call DependOnVariable, VARDEP_TEST_VAR)
243
$(SED) -e 's/XXX/$(VARDEP_TEST_VAR)/g' $< > $@
244
$(TOUCH) $(VARDEP_FLAG_FILE)
247
$(RM) $(VARDEP_SRC_FILE) $(VARDEP_TARGET_FILE) $(VARDEP_FLAG_FILE)
249
# Simply create the target file and verify that it has the correct value
251
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR=value1 $(VARDEP_TARGET_FILE)
252
$(PRINTF) "Expecting value1: %s\n" "`$(CAT) $(VARDEP_DIR)/target-file`"
253
test "some string value1" = "`$(CAT) $(VARDEP_DIR)/target-file`"
254
test -e $(VARDEP_FLAG_FILE)
256
# Make the target file again and verify that the value is updated with
260
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR=value2 $(VARDEP_TARGET_FILE)
261
$(PRINTF) "Expecting value2: %s\n" "`$(CAT) $(VARDEP_DIR)/target-file`"
262
test "some string value2" = "`$(CAT) $(VARDEP_DIR)/target-file`"
263
test -e $(VARDEP_FLAG_FILE)
265
# Make the target again with the same value and verify that the recipe
266
# was never run by checking that the flag file was not recreated
269
$(RM) $(VARDEP_FLAG_FILE)
270
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR=value2 $(VARDEP_TARGET_FILE)
271
$(PRINTF) "Expecting value2: %s\n" "`$(CAT) $(VARDEP_DIR)/target-file`"
272
test "some string value2" = "`$(CAT) $(VARDEP_DIR)/target-file`"
273
test ! -e $(VARDEP_FLAG_FILE)
275
# Test running with spaces at the end and the middle of the value
276
# and verify that the file isn't rewritten the second time
278
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR="value3 foo " $(VARDEP_TARGET_FILE)
279
$(RM) $(VARDEP_FLAG_FILE)
280
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR="value3 foo" $(VARDEP_TARGET_FILE)
281
test ! -e $(VARDEP_FLAG_FILE)
282
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR=" value3 foo" $(VARDEP_TARGET_FILE)
283
test ! -e $(VARDEP_FLAG_FILE)
285
# Test including some problematic characters
286
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR='value4 \$$ORIGIN' $(VARDEP_TARGET_FILE)
287
$(RM) $(VARDEP_FLAG_FILE)
288
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR='value4 \$$ORIGIN' $(VARDEP_TARGET_FILE)
289
test ! -e $(VARDEP_FLAG_FILE)
291
# Test having the variable be empty, first from scratch, with even
292
# the vardep file deleted.
294
$(RM) $(VARDEP_FLAG_FILE) $(VARDEP_TARGET_FILE) \
295
$(call DependOnVariableFileName,VARDEP_TEST_VAR)
296
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR="" $(VARDEP_TARGET_FILE)
297
$(PRINTF) "Expecting '': %s\n" "`$(CAT) $(VARDEP_DIR)/target-file`"
298
test "some string " = "`$(CAT) $(VARDEP_DIR)/target-file`"
299
test -e $(VARDEP_FLAG_FILE)
301
# Then rebuild with same empty value, nothing should happen
303
$(RM) $(VARDEP_FLAG_FILE)
304
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR="" $(VARDEP_TARGET_FILE)
305
$(PRINTF) "Expecting '': %s\n" "`$(CAT) $(VARDEP_DIR)/target-file`"
306
test "some string " = "`$(CAT) $(VARDEP_DIR)/target-file`"
307
test ! -e $(VARDEP_FLAG_FILE)
309
# Try setting a value again and verify that the target gets rebuilt
311
$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR=value2 $(VARDEP_TARGET_FILE)
312
$(PRINTF) "Expecting value2: %s\n" "`$(CAT) $(VARDEP_DIR)/target-file`"
313
test "some string value2" = "`$(CAT) $(VARDEP_DIR)/target-file`"
314
test -e $(VARDEP_FLAG_FILE)
316
# Test specifying a specific value file to store variable in
317
VARDEP_VALUE_FILE := $(VARDEP_DIR)/value-file
318
VARDEP_TEST_VAR2 := value3
320
VARDEP_RETURN_VALUE := $(call DependOnVariable, VARDEP_TEST_VAR2, $(VARDEP_VALUE_FILE))
321
$(call AssertEquals, $(VARDEP_RETURN_VALUE), $(VARDEP_VALUE_FILE), \
322
Wrong filename returned)
323
-include $(VARDEP_VALUE_FILE)
324
$(call AssertEquals, $(VARDEP_TEST_VAR2_old), $(VARDEP_TEST_VAR2), \
325
Wrong contents in vardeps file)
327
# Test with a variable value containing some problematic characters
328
VARDEP_TEST_VAR3 := foo '""' "''" bar \$$ORIGIN &\#x00a9
329
VARDEP_VALUE_FILE := $(call DependOnVariable, VARDEP_TEST_VAR3)
330
-include $(VARDEP_VALUE_FILE)
331
$(call AssertEquals, $(call EscapeHash,$(VARDEP_TEST_VAR3_old)), \
332
$(call EscapeHash,$(VARDEP_TEST_VAR3)), \
333
Wrong contents in vardep file)
335
TEST_TARGETS += test-vardep
337
################################################################################
340
ifneq ($(call sequence, 1, 1), 1)
341
$(error Sequence 1, 1 should be "1", but was $(call sequence, 1, 1))
344
ifneq ($(call sequence, 2, 3), 2 3)
345
$(error Sequence 2, 3 should be "2 3", but was $(call sequence, 2, 3))
348
ifneq ($(call sequence, 4, 9), 4 5 6 7 8 9)
349
$(error Sequence 4, 9 should be "4 5 6 7 8 9", but was $(call sequence, 4, 9))
352
ifneq ($(call sequence, 5, 15), 5 6 7 8 9 10 11 12 13 14 15)
353
$(error Sequence 5, 15 should be "5 6 7 8 9 10 11 12 13 14 15", \
354
but was $(call sequence, 5, 15))
357
################################################################################
358
# Test that PathList is safe when called multiple nested times.
360
PATHLIST_INPUT := foo bar baz
362
$(call AssertEquals, \
363
$(call PathList, $(call PathList, $(PATHLIST_INPUT))), \
364
$(call PathList, $(PATHLIST_INPUT)), \
365
PathList call not safe for calling twice, \
368
################################################################################
369
# Test FindCommonPathPrefix
371
$(call AssertEquals, \
372
$(call FindCommonPathPrefix, /foo/bar/baz, /foo/bar/banan), \
374
FindCommonPathPrefix, \
377
$(call AssertEquals, \
378
$(call FindCommonPathPrefix, /foo/bar/baz, /foo/bar), \
380
FindCommonPathPrefix, \
383
$(call AssertEquals, \
384
$(call FindCommonPathPrefix, /foo/bar/baz, /foo/bar/), \
386
FindCommonPathPrefix, \
389
$(call AssertEquals, \
390
$(call FindCommonPathPrefix, foo/bar/baz, foo/bar/banan), \
392
FindCommonPathPrefix, \
395
$(call AssertEquals, \
396
$(call FindCommonPathPrefix, foo/bar/baz, /foo/bar/banan), \
398
FindCommonPathPrefix, \
401
$(call AssertEquals, \
402
$(call FindCommonPathPrefix, /foo/bar/, /foo/bar), \
404
FindCommonPathPrefix, \
407
$(call AssertEquals, \
408
$(call FindCommonPathPrefix, /fo oo/bar1/, /fo oo/bar2), \
410
FindCommonPathPrefix, \
413
################################################################################
416
$(call AssertEquals, \
417
$(call RelativePath, foo/bar/baz, foo/bar/banan), \
422
$(call AssertEquals, \
423
$(call RelativePath, foo/bar/baz/banan/kung, foo/bar/banan/kung), \
424
../../baz/banan/kung, \
428
$(call AssertEquals, \
429
$(call RelativePath, /foo/bar/baz/banan/kung, /foo/bar/banan/kung/), \
430
../../baz/banan/kung, \
434
$(call AssertEquals, \
435
$(call RelativePath, /foo/bar/baz/banan/kung, /foo/bar/baz), \
440
$(call AssertEquals, \
441
$(call RelativePath, /foo/bar/baz/banan/kung, /foo/bar/baz/), \
446
$(call AssertEquals, \
447
$(call RelativePath, /foo/bar, /foo/bar/baz), \
452
$(call AssertEquals, \
453
$(call RelativePath, /foo/bar/baz/, /foo/bar/baz), \
458
$(call AssertEquals, \
459
$(call RelativePath, /fo oo/bar/baz/ban an, /fo oo/bar/), \
464
$(call AssertEquals, \
465
$(call RelativePath, /foo/ba rr/ba zz, /foo/ba rr/banan), \
470
$(call AssertEquals, \
471
$(call RelativePath, /foo, /bar), \
476
################################################################################
477
# Test ParseKeywordVariable
479
KWBASE := APA=banan;GURKA=tomat;COUNT=1%202%203%204%205;SUM=1+2+3+4+5;MANY_WORDS=I have the best words.
481
$(eval $(call ParseKeywordVariable, KWBASE, \
482
SINGLE_KEYWORDS := APA GURKA SUM, \
483
STRING_KEYWORDS := COUNT MANY_WORDS, \
486
$(call AssertEquals, \
489
ParseKeywordVariable failed to parse APA, \
492
$(call AssertEquals, \
495
ParseKeywordVariable failed to parse COUNT, \
498
$(call AssertEquals, \
501
ParseKeywordVariable failed to parse SUM, \
504
$(call AssertEquals, \
505
$(KWBASE_MANY_WORDS), \
506
I have the best words., \
507
ParseKeywordVariable failed to parse MANY_WORDS, \
510
# Simulate variable set from command line by using "override"
511
override KWBASE_WEIRD_GURKA := paprika
512
KWBASE_WEIRD := ;;APA=banan;;;GURKA=apelsin;APA=skansen;;
514
$(eval $(call ParseKeywordVariable, KWBASE_WEIRD, \
515
SINGLE_KEYWORDS := APA GURKA SUM, \
516
STRING_KEYWORDS := COUNT, \
519
$(call AssertEquals, \
520
$(KWBASE_WEIRD_APA), \
522
ParseKeywordVariable failed to overwrite APA, \
525
$(call AssertEquals, \
526
$(KWBASE_WEIRD_GURKA), \
528
ParseKeywordVariable failed to preserve GURKA, \
531
################################################################################
532
# Test recursive wildcard
534
A_FOOBAR := $(OUTPUT_DIR)/wildcard/a/foo.bar
535
A_B_DOOBAR := $(OUTPUT_DIR)/wildcard/a/b/doo.bar
536
A_B_FOOBAR := $(OUTPUT_DIR)/wildcard/a/b/foo.bar
537
A_B_FOOBAZ := $(OUTPUT_DIR)/wildcard/a/b/foo.baz
538
X_Y_FOOBAR := $(OUTPUT_DIR)/wildcard/x/y/foo.bar
539
X_Y_FOOBAZ := $(OUTPUT_DIR)/wildcard/x/y/foo.baz
540
X_Y_FOODOLLAR := $(OUTPUT_DIR)/wildcard/x/y/foo$$foo
542
$(call MakeDir, $(OUTPUT_DIR)/wildcard/a/b)
543
$(call MakeDir, $(OUTPUT_DIR)/wildcard/x/y)
544
$(shell $(TOUCH) $(A_FOOBAR) $(A_B_FOOBAR) $(A_B_DOOBAR) $(A_B_FOOBAZ) \
545
$(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(call ShellQuote, $(X_Y_FOODOLLAR)))
547
ifeq ($(RWILDCARD_WORKS), true)
548
$(call AssertEquals, \
549
$(sort $(call rwildcard, $(OUTPUT_DIR)/wildcard, *.bar)), \
550
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_FOOBAR) $(X_Y_FOOBAR)), \
551
Wrong files returned from rwildcard, \
554
$(call AssertEquals, \
555
$(sort $(call rwildcard, $(OUTPUT_DIR)/wildcard, doo.*)), \
557
Wrong files returned from rwildcard, \
560
$(call AssertEquals, \
561
$(sort $(call rwildcard, $(OUTPUT_DIR)/wildcard, *.bar *.baz)), \
562
$(sort $(A_B_DOOBAR) $(A_FOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \
563
$(X_Y_FOOBAR) $(X_Y_FOOBAZ)), \
564
Wrong files returned from rwildcard, \
567
$(call AssertEquals, \
568
$(sort $(call WildcardFindFiles, $(OUTPUT_DIR)/wildcard)), \
569
$(sort $(A_B_DOOBAR) $(A_FOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \
570
$(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
571
Wrong files returned from WildcardFindFiles, \
574
$(call AssertEquals, \
575
$(sort $(call WildcardFindFiles, $(OUTPUT_DIR)/wildcard/x/y)), \
576
$(sort $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
577
Wrong files returned from WildcardFindFiles, \
580
$(call AssertEquals, \
581
$(sort $(call WildcardFindFiles, $(OUTPUT_DIR)/wildcard/a/b $(OUTPUT_DIR)/wildcard/x)), \
582
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \
583
$(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
584
Wrong files returned from WildcardFindFiles, \
588
$(call AssertEquals, \
589
$(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard)), \
590
$(sort $(A_B_DOOBAR) $(A_FOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \
591
$(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
592
Wrong files returned from ShellFindFiles, \
595
$(call AssertEquals, \
596
$(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard/x/y)), \
597
$(sort $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
598
Wrong files returned from ShellFindFiles, \
601
$(call AssertEquals, \
602
$(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard/a/b $(OUTPUT_DIR)/wildcard/x)), \
603
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \
604
$(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
605
Wrong files returned from ShellFindFiles, \
608
$(call AssertEquals, \
609
$(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard, *.bar)), \
610
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_FOOBAR) $(X_Y_FOOBAR)), \
611
Wrong files returned from ShellFindFiles, \
614
$(call AssertEquals, \
615
$(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard, doo.*)), \
617
Wrong files returned from ShellFindFiles, \
620
$(call AssertEquals, \
621
$(sort $(call ShellFindFiles, $(OUTPUT_DIR)/wildcard, *.bar *.baz)), \
622
$(sort $(A_B_DOOBAR) $(A_FOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) \
623
$(X_Y_FOOBAR) $(X_Y_FOOBAZ)), \
624
Wrong files returned from ShellFindFiles, \
627
################################################################################
629
$(call AssertEquals, \
630
$(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/a/b)), \
631
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ)), \
632
CacheFindFiles test 1, \
634
$(call FillFindCache, $(OUTPUT_DIR)/wildcard/a/b)
635
$(call AssertEquals, \
636
$(CacheFindFiles_CACHED_DIRS), $(OUTPUT_DIR)/wildcard/a/b, \
637
Wrong files in find cache dirs, \
639
$(call AssertEquals, \
640
$(sort $(CacheFindFiles_CACHED_FILES)), \
641
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ)), \
642
Wrong files in find cache files, \
644
$(call AssertEquals, \
645
$(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/a/b)), \
646
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ)), \
647
CacheFindFiles test 1, \
650
$(call AssertEquals, \
651
$(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/a)), \
652
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) $(A_FOOBAR)), \
653
CacheFindFiles test 2, \
655
$(call FillFindCache, $(OUTPUT_DIR)/wildcard/a)
656
$(call AssertEquals, \
657
$(CacheFindFiles_CACHED_DIRS), \
658
$(OUTPUT_DIR)/wildcard/a/b $(OUTPUT_DIR)/wildcard/a, \
659
Wrong files in find cache dirs, \
661
$(call AssertEquals, \
662
$(sort $(CacheFindFiles_CACHED_FILES)), \
663
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) $(A_FOOBAR)), \
664
Wrong files in find cache files, \
666
$(call AssertEquals, \
667
$(words $(CacheFindFiles_CACHED_FILES)), 4, \
668
Wrong files in find cache files >$(CacheFindFiles_CACHED_FILES)<, \
670
$(call AssertEquals, \
671
$(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/a)), \
672
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) $(A_FOOBAR)), \
673
CacheFindFiles test 2, \
676
$(call AssertEquals, \
677
$(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/x)), \
678
$(sort $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
679
CacheFindFiles test 3, \
681
$(call FillFindCache, $(OUTPUT_DIR)/wildcard/x)
682
$(call AssertEquals, \
683
$(CacheFindFiles_CACHED_DIRS), \
684
$(OUTPUT_DIR)/wildcard/a/b $(OUTPUT_DIR)/wildcard/a $(OUTPUT_DIR)/wildcard/x, \
685
Wrong files in find cache dirs, \
687
$(call AssertEquals, \
688
$(sort $(CacheFindFiles_CACHED_FILES)), \
689
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) $(A_FOOBAR) \
690
$(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
691
Wrong files in find cache files, \
693
$(call AssertEquals, \
694
$(words $(CacheFindFiles_CACHED_FILES)), 7, \
695
Wrong files in find cache files, \
697
$(call AssertEquals, \
698
$(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/x)), \
699
$(sort $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
700
CacheFindFiles test 3, \
703
$(call AssertEquals, \
704
$(sort $(call CacheFindFiles, $(OUTPUT_DIR)/wildcard/x/y)), \
705
$(sort $(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
706
CacheFindFiles test 4, \
708
$(call FillFindCache, $(OUTPUT_DIR)/wildcard/x/y)
709
$(call AssertEquals, \
710
$(CacheFindFiles_CACHED_DIRS), \
711
$(OUTPUT_DIR)/wildcard/a/b $(OUTPUT_DIR)/wildcard/a $(OUTPUT_DIR)/wildcard/x, \
712
Wrong files in find cache dirs, \
714
$(call AssertEquals, \
715
$(sort $(CacheFindFiles_CACHED_FILES)), \
716
$(sort $(A_B_DOOBAR) $(A_B_FOOBAR) $(A_B_FOOBAZ) $(A_FOOBAR) \
717
$(X_Y_FOOBAR) $(X_Y_FOOBAZ) $(X_Y_FOODOLLAR)), \
718
Wrong files in find cache files, \
720
$(call AssertEquals, \
721
$(words $(CacheFindFiles_CACHED_FILES)), 7, \
722
Wrong files in find cache files, \
725
################################################################################