From 0806a403d65ef6a7f16e2c17aa8286100ebad5d7 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Wed, 15 Feb 2006 23:54:42 +0000 Subject: Fix Savannah bug #106: keep separate track of which variable we are expanding, and use that info when generating error messages instead of the file info, where appropriate. --- tests/scripts/functions/foreach | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests/scripts/functions/foreach') diff --git a/tests/scripts/functions/foreach b/tests/scripts/functions/foreach index 1fde12e..904c160 100644 --- a/tests/scripts/functions/foreach +++ b/tests/scripts/functions/foreach @@ -57,4 +57,25 @@ $(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; -- cgit v1.2.3