VirtualBox

source: kBuild/trunk/src/kmk/tests/scripts/functions/substitution@ 1839

Last change on this file since 1839 was 969, checked in by bird, 18 years ago

Fixing some svn props.

  • Property svn:eol-style set to LF
File size: 890 bytes
Line 
1# -*-perl-*-
2
3$description = "Test the subst and patsubst functions";
4
5$details = "";
6
7# Generic patsubst test: test both the function and variable form.
8
9run_make_test('
10foo := a.o b.o c.o
11bar := $(foo:.o=.c)
12bar2:= $(foo:%.o=%.c)
13bar3:= $(patsubst %.c,%.o,x.c.c bar.c)
14all:;@echo $(bar); echo $(bar2); echo $(bar3)',
15'',
16'a.c b.c c.c
17a.c b.c c.c
18x.c.o bar.o');
19
20# Patsubst without '%'--shouldn't match because the whole word has to match
21# in patsubst. Based on a bug report by Markus Mauhart <[email protected]>
22
23run_make_test('all:;@echo $(patsubst Foo,Repl,FooFoo)', '', 'FooFoo');
24
25# Variable subst where a pattern matches multiple times in a single word.
26# Based on a bug report by Markus Mauhart <[email protected]>
27
28run_make_test('
29A := fooBARfooBARfoo
30all:;@echo $(A:fooBARfoo=REPL)', '', 'fooBARREPL');
31
321;
33
34
35
36
37
38
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