VirtualBox

source: kBuild/vendor/gnumake/current/tests/scripts/functions/filter-out@ 3138

Last change on this file since 3138 was 3138, checked in by bird, 7 years ago

Imported make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6) from https://git.savannah.gnu.org/git/make.git.

  • Property svn:eol-style set to LF
File size: 1.5 KB
Line 
1# -*-perl-*-
2
3$description = "Test the filter and filter-out functions.";
4
5$details = "The makefile created in this test has two variables. The
6filter-out function is first used to discard names ending in
7.o with a single simple pattern. The second filter-out function
8augments the simple pattern with three literal names, which are
9also added to the text argument. This tests an internal hash table
10which is only used if there are multiple literals present in both
11the pattern and text arguments. The result of both filter-out
12functions is the same single .elc name.\n";
13
14# Basic test -- filter
15run_make_test(q!
16files1 := $(filter %.o, foo.elc bar.o lose.o)
17files2 := $(filter %.o foo.i, foo.i bar.i lose.i foo.elc bar.o lose.o)
18all: ; @echo '$(files1) $(files2)'
19!,
20 '', "bar.o lose.o foo.i bar.o lose.o\n");
21
22# Basic test -- filter-out
23run_make_test(q!
24files1 := $(filter-out %.o, foo.elc bar.o lose.o)
25files2 := $(filter-out foo.i bar.i lose.i %.o, foo.i bar.i lose.i foo.elc bar.o lose.o)
26all: ; @echo '$(files1) $(files2)'
27!,
28 '', "foo.elc foo.elc\n");
29
30# Escaped patterns
31run_make_test(q!all:;@echo '$(filter foo\%bar,foo%bar fooXbar)'!,
32 '', "foo%bar\n");
33
34run_make_test(q!all:;@echo '$(filter foo\%\%\\\\\%\%bar,foo%%\\%%bar fooX\\Ybar)'!,
35 '', "foo%%\\%%bar\n");
36
37run_make_test(q!
38X = $(filter foo\\\\\%bar,foo\%bar foo\Xbar)
39all:;@echo '$(X)'!,
40 '', "foo\\%bar\n");
41
421;
Note: See TracBrowser for help on using the repository browser.

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