summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog5
-rw-r--r--tests/scripts/functions/eval31
2 files changed, 36 insertions, 0 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 3c62080..e91ccc9 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2002-10-25 Paul D. Smith <psmith@gnu.org>
+
+ * scripts/functions/eval: Test using $(eval ...) inside
+ conditionals (Bug #1516).
+
2002-10-13 Paul D. Smith <psmith@gnu.org>
* scripts/features/targetvars: Add a test for exporting
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;