xref: /netbsd-src/external/gpl2/gmake/dist/tests/scripts/functions/addsuffix (revision 69606e3f5c9388e52aed8c120ad63c049ca45d8f)
1*69606e3fSchristos#                                                                    -*-perl-*-
2*69606e3fSchristos$description = "Test the addsuffix function.";
3*69606e3fSchristos
4*69606e3fSchristos$details = "";
5*69606e3fSchristos
6*69606e3fSchristos
7*69606e3fSchristosopen(MAKEFILE,"> $makefile");
8*69606e3fSchristos
9*69606e3fSchristos# The Contents of the MAKEFILE ...
10*69606e3fSchristos
11*69606e3fSchristosprint MAKEFILE <<EOMAKE;
12*69606e3fSchristosstring := \$(addsuffix .c,src${pathsep}a.b.z.foo hacks)
13*69606e3fSchristosone: ; \@echo \$(string)
14*69606e3fSchristos
15*69606e3fSchristostwo: ; \@echo \$(addsuffix foo,)
16*69606e3fSchristosEOMAKE
17*69606e3fSchristos
18*69606e3fSchristosclose(MAKEFILE);
19*69606e3fSchristos
20*69606e3fSchristos
21*69606e3fSchristos# TEST 0
22*69606e3fSchristos
23*69606e3fSchristos&run_make_with_options($makefile, "", &get_logfile);
24*69606e3fSchristos$answer = "src${pathsep}a.b.z.foo.c hacks.c\n";
25*69606e3fSchristos&compare_output($answer,&get_logfile(1));
26*69606e3fSchristos
27*69606e3fSchristos
28*69606e3fSchristos# TEST 1
29*69606e3fSchristos
30*69606e3fSchristos&run_make_with_options($makefile, "two", &get_logfile);
31*69606e3fSchristos$answer = "\n";
32*69606e3fSchristos&compare_output($answer,&get_logfile(1));
33*69606e3fSchristos
34*69606e3fSchristos
35*69606e3fSchristos# This tells the test driver that the perl test script executed properly.
36*69606e3fSchristos1;
37