diff options
author | Paul Smith <psmith@gnu.org> | 2002-10-25 22:01:47 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2002-10-25 22:01:47 +0000 |
commit | d696707cb5009308baa345ff60c8378512b07edb (patch) | |
tree | 480e6f04e132649d7346adc8eb92d090f85aabde /tests | |
parent | bd108cf45cca0a37cb82aca0f3f3516e593d638b (diff) | |
download | gunmake-d696707cb5009308baa345ff60c8378512b07edb.tar.gz |
Fix eval bugs 1516 and 1517.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ChangeLog | 5 | ||||
-rw-r--r-- | tests/scripts/functions/eval | 31 |
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; |