Imported Upstream version 3.82
[platform/upstream/make.git] / tests / scripts / functions / filter-out
1 #                                                                    -*-perl-*-
2
3 $description = "Test the filter-out function.";
4
5 $details = "The makefile created in this test has two variables.  The
6 filter-out function is first used to discard names ending in
7 .o with a single simple pattern.  The second filter-out function
8 augments the simple pattern with three literal names, which are
9 also added to the text argument.  This tests an internal hash table
10 which is only used if there are multiple literals present in both
11 the pattern and text arguments.  The result of both filter-out
12 functions is the same single .elc name.\n";
13
14 open(MAKEFILE,"> $makefile");
15
16 print MAKEFILE <<'EOF';
17 files1 := $(filter-out %.o, foo.elc bar.o lose.o)
18 files2 := $(filter-out foo.i bar.i lose.i %.o, foo.i bar.i lose.i foo.elc bar.o lose.o)
19 all: ; @echo $(files1) $(files2)
20 EOF
21
22 close(MAKEFILE);
23
24 &run_make_with_options($makefile, "", &get_logfile, 0);
25 $answer = "foo.elc foo.elc\n";
26 &compare_output($answer,&get_logfile(1));
27
28 1;