diff options
author | Lukc <lukc@upyum.com> | 2010-12-12 04:13:19 +0100 |
---|---|---|
committer | Lukc <lukc@upyum.com> | 2010-12-12 04:13:19 +0100 |
commit | 9769d39d792c1e912234e23e663ba8bd21a6386e (patch) | |
tree | 76bf5a6a6c756cf78c73a847b2ff3ec97f048ee7 /make/make-3.81/tests/scripts/functions/foreach | |
parent | abb6804a2c95065cbc228c3726781d44ed04e6cd (diff) | |
download | base-9769d39d792c1e912234e23e663ba8bd21a6386e.tar.gz base-9769d39d792c1e912234e23e663ba8bd21a6386e.tar.bz2 base-9769d39d792c1e912234e23e663ba8bd21a6386e.tar.xz base-9769d39d792c1e912234e23e663ba8bd21a6386e.zip |
Recette de make retir?e.
Diffstat (limited to 'make/make-3.81/tests/scripts/functions/foreach')
-rw-r--r-- | make/make-3.81/tests/scripts/functions/foreach | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/make/make-3.81/tests/scripts/functions/foreach b/make/make-3.81/tests/scripts/functions/foreach deleted file mode 100644 index 82e99d7..0000000 --- a/make/make-3.81/tests/scripts/functions/foreach +++ /dev/null @@ -1,77 +0,0 @@ -# -*-perl-*- -# $Id: foreach,v 1.5 2006/03/10 02:20:46 psmith Exp $ - -$description = "Test the foreach function."; - -$details = "This is a test of the foreach function in gnu make. -This function starts with a space separated list of -names and a variable. Each name in the list is subsituted -into the variable and the given text evaluated. The general -form of the command is $(foreach var,$list,$text). Several -types of foreach loops are tested\n"; - - -# TEST 0 - -# Set an environment variable that we can test in the makefile. -$extraENV{FOOFOO} = 'foo foo'; - -run_make_test("space = ' '".' -null := -auto_var = udef space CC null FOOFOO MAKE foo CFLAGS WHITE @ < -foo = bletch null @ garf -av = $(foreach var, $(auto_var), $(origin $(var)) ) -override WHITE := BLACK -for_var = $(addsuffix .c,foo $(null) $(foo) $(space) $(av) ) -fe = $(foreach var2, $(for_var),$(subst .c,.o, $(var2) ) ) -all: auto for2 -auto : ; @echo $(av) -for2: ; @echo $(fe)', - '-e WHITE=WHITE CFLAGS=', - "undefined file default file environment default file command line override automatic automatic -foo.o bletch.o null.o @.o garf.o .o .o undefined.o file.o default.o file.o environment.o default.o file.o command.o line.o override.o automatic.o automatic.o"); - -delete $extraENV{FOOFOO}; - -# TEST 1: Test that foreach variables take precedence over global -# variables in a global scope (like inside an eval). Tests bug #11913 - -run_make_test(' -.PHONY: all target -all: target - -x := BAD - -define mktarget -target: x := $(x) -target: ; @echo "$(x)" -endef - -x := GLOBAL - -$(foreach x,FOREACH,$(eval $(value mktarget)))', - '', - 'FOREACH'); - - -# TEST 2: Check some error conditions. - -run_make_test(' -x = $(foreach ) -y = $x - -all: ; @echo $y', - '', - "#MAKEFILE#:2: *** insufficient number of arguments (1) to function `foreach'. Stop.", - 512); - -run_make_test(' -x = $(foreach ) -y := $x - -all: ; @echo $y', - '', - "#MAKEFILE#:2: *** insufficient number of arguments (1) to function `foreach'. Stop.", - 512); - -1; |