summaryrefslogtreecommitdiff
path: root/tests/scripts/options
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2009-10-25 00:46:52 +0000
committerPaul Smith <psmith@gnu.org>2009-10-25 00:46:52 +0000
commit4e51b6d9a4eb7eef2272551d55d8abaadd5f01e3 (patch)
treefd4867c9098333197abe49c21e27caf920c35b25 /tests/scripts/options
parent606cf9b169f23b8d87b20ea02b235df8fa66c2d8 (diff)
downloadgunmake-4e51b6d9a4eb7eef2272551d55d8abaadd5f01e3.tar.gz
New command line option: --eval=STRING will cause STRING to be
evaluated as a makefile statement before the first makefile is read.
Diffstat (limited to 'tests/scripts/options')
-rw-r--r--tests/scripts/options/eval19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/scripts/options/eval b/tests/scripts/options/eval
new file mode 100644
index 0000000..06a035c
--- /dev/null
+++ b/tests/scripts/options/eval
@@ -0,0 +1,19 @@
+# -*-perl-*-
+
+$description = "Test the --eval option.";
+
+$details = "Verify that --eval options take effect,
+and are passed to sub-makes.";
+
+# Verify that --eval is evaluated first
+run_make_test(q!
+BAR = bar
+all: ; @echo all
+recurse: ; @$(MAKE) -f #MAKEFILE# && echo recurse!,
+ '--eval=\$\(info\ eval\) FOO=\$\(BAR\)', "eval\nall");
+
+# Make sure that --eval is handled correctly during recursion
+run_make_test(undef, '--no-print-directory --eval=\$\(info\ eval\) recurse',
+ "eval\neval\nall\nrecurse");
+
+1;