diff options
author | Anas Nashif <anas.nashif@intel.com> | 2012-11-05 11:16:30 -0800 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2012-11-05 11:16:30 -0800 |
commit | 9789b4dba120180760ec948089fc98ebab6eb28b (patch) | |
tree | 26ae9736985be2ef61032e7808b9fb0e2155c71f /tests/scripts/functions/filter-out | |
download | make-9789b4dba120180760ec948089fc98ebab6eb28b.tar.gz make-9789b4dba120180760ec948089fc98ebab6eb28b.tar.bz2 make-9789b4dba120180760ec948089fc98ebab6eb28b.zip |
Imported Upstream version 3.82upstream/3.82
Diffstat (limited to 'tests/scripts/functions/filter-out')
-rw-r--r-- | tests/scripts/functions/filter-out | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/scripts/functions/filter-out b/tests/scripts/functions/filter-out new file mode 100644 index 0000000..6c8b27a --- /dev/null +++ b/tests/scripts/functions/filter-out @@ -0,0 +1,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; |