~ubuntu-branches/debian/sid/make-doc-non-dfsg/sid

« back to all changes in this revision

Viewing changes to tests/scripts/functions/substitution

  • Committer: Package Import Robot
  • Author(s): Manoj Srivastava
  • Date: 2014-05-04 18:48:47 UTC
  • mfrom: (4.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20140504184847-50zxi1b08m22ehle
Tags: 4.0-2
Move to usntable, since the make binary package has been uploaded
there. No changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
9
run_make_test('
 
10
foo := a.o b.o c.o
 
11
bar := $(foo:.o=.c)
 
12
bar2:= $(foo:%.o=%.c)
 
13
bar3:= $(patsubst %.c,%.o,x.c.c bar.c)
 
14
all:;@echo $(bar); echo $(bar2); echo $(bar3)',
 
15
'',
 
16
'a.c b.c c.c
 
17
a.c b.c c.c
 
18
x.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 <qwe123@chello.at>
 
22
 
 
23
run_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 <qwe123@chello.at>
 
27
 
 
28
run_make_test('
 
29
A := fooBARfooBARfoo
 
30
all:;@echo $(A:fooBARfoo=REPL)', '', 'fooBARREPL');
 
31
 
 
32
1;
 
33
 
 
34
 
 
35
 
 
36
 
 
37
 
 
38