summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2010-07-12 05:29:25 +0000
committerPaul Smith <psmith@gnu.org>2010-07-12 05:29:25 +0000
commitbbe7b86718cead9196d48ffdb441c4408053ae1c (patch)
treeab39ab8b39f2b63e08ea0ea1348905788d1e223f
parent7ba7dbca47e20159d046fab847ebb0ef6673b24a (diff)
downloadgunmake-bbe7b86718cead9196d48ffdb441c4408053ae1c.tar.gz
Forgot to add the ONESHELL regression tests.
-rw-r--r--tests/scripts/targets/ONESHELL70
1 files changed, 70 insertions, 0 deletions
diff --git a/tests/scripts/targets/ONESHELL b/tests/scripts/targets/ONESHELL
new file mode 100644
index 0000000..5b86e48
--- /dev/null
+++ b/tests/scripts/targets/ONESHELL
@@ -0,0 +1,70 @@
+# -*-perl-*-
+
+$description = "Test the behaviour of the .ONESHELL target.";
+
+$details = "";
+
+
+# Simple
+
+run_make_test(q!
+.ONESHELL:
+all:
+ a=$$$$
+ [ 0"$$a" -eq "$$$$" ] || echo fail
+!,
+ '', 'a=$$
+[ 0"$a" -eq "$$" ] || echo fail
+');
+
+# Again, but this time with inner prefix chars
+
+run_make_test(q!
+.ONESHELL:
+all:
+ a=$$$$
+ @-+ [ 0"$$a" -eq "$$$$" ] || echo fail
+!,
+ '', 'a=$$
+[ 0"$a" -eq "$$" ] || echo fail
+');
+
+# This time with outer prefix chars
+
+run_make_test(q!
+.ONESHELL:
+all:
+ @a=$$$$
+ [ 0"$$a" -eq "$$$$" ] || echo fail
+!,
+ '', '');
+
+
+# This time with outer and inner prefix chars
+
+run_make_test(q!
+.ONESHELL:
+all:
+ @a=$$$$
+ -@ +[ 0"$$a" -eq "$$$$" ] || echo fail
+!,
+ '', '');
+
+
+# Now try using a different interpreter
+
+run_make_test(q!
+.RECIPEPREFIX = >
+.ONESHELL:
+SHELL = #PERL#
+.SHELLFLAGS = -e
+all:
+> @$$a=5
+> +7;
+> @y=qw(a b c);
+>print "a = $$a, \
+y = (@y)\n";
+!,
+ '', "a = 12, y = (a b c)\n");
+
+1;