summaryrefslogtreecommitdiff
path: root/tests/scripts/functions
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2002-10-25 22:01:47 +0000
committerPaul Smith <psmith@gnu.org>2002-10-25 22:01:47 +0000
commitd696707cb5009308baa345ff60c8378512b07edb (patch)
tree480e6f04e132649d7346adc8eb92d090f85aabde /tests/scripts/functions
parentbd108cf45cca0a37cb82aca0f3f3516e593d638b (diff)
downloadgunmake-d696707cb5009308baa345ff60c8378512b07edb.tar.gz
Fix eval bugs 1516 and 1517.
Diffstat (limited to 'tests/scripts/functions')
-rw-r--r--tests/scripts/functions/eval31
1 files changed, 31 insertions, 0 deletions
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;