From d696707cb5009308baa345ff60c8378512b07edb Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Fri, 25 Oct 2002 22:01:47 +0000 Subject: Fix eval bugs 1516 and 1517. --- tests/scripts/functions/eval | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'tests/scripts/functions/eval') diff --git a/tests/scripts/functions/eval b/tests/scripts/functions/eval index 0d5e3b8..174767d 100644 --- a/tests/scripts/functions/eval +++ b/tests/scripts/functions/eval @@ -57,4 +57,35 @@ $answer = "A = A B = B\n"; &compare_output($answer,&get_logfile(1)); +# Test to make sure eval'ing inside conditionals works properly + +$makefile3 = &get_tmpfile; + +open(MAKEFILE,"> $makefile3"); + +print MAKEFILE <<'EOF'; +FOO = foo + +all:: ; @echo it + +define Y + all:: ; @echo worked +endef + +ifdef BAR +$(eval $(Y)) +endif + +EOF + +close(MAKEFILE); + +&run_make_with_options($makefile3, "", &get_logfile); +$answer = "it\n"; +&compare_output($answer,&get_logfile(1)); + +&run_make_with_options($makefile3, "BAR=1", &get_logfile); +$answer = "it\nworked\n"; +&compare_output($answer,&get_logfile(1)); + 1; -- cgit v1.2.3