summaryrefslogtreecommitdiff
path: root/tests/scripts/functions/filter-out
blob: 6c8b27a838c54680cee4d88cd5215dc2844e0d56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#                                                                    -*-perl-*-

$description = "Test the filter-out function.";

$details = "The makefile created in this test has two variables.  The
filter-out function is first used to discard names ending in
.o with a single simple pattern.  The second filter-out function
augments the simple pattern with three literal names, which are
also added to the text argument.  This tests an internal hash table
which is only used if there are multiple literals present in both
the pattern and text arguments.  The result of both filter-out
functions is the same single .elc name.\n";

open(MAKEFILE,"> $makefile");

print MAKEFILE <<'EOF';
files1 := $(filter-out %.o, foo.elc bar.o lose.o)
files2 := $(filter-out foo.i bar.i lose.i %.o, foo.i bar.i lose.i foo.elc bar.o lose.o)
all: ; @echo $(files1) $(files2)
EOF

close(MAKEFILE);

&run_make_with_options($makefile, "", &get_logfile, 0);
$answer = "foo.elc foo.elc\n";
&compare_output($answer,&get_logfile(1));

1;