From aee7f1165a990f588e8819652c4adf09c6cafae6 Mon Sep 17 00:00:00 2001 From: psmith Date: Mon, 12 Jul 2010 05:29:25 +0000 Subject: [PATCH] Forgot to add the ONESHELL regression tests. --- tests/scripts/targets/ONESHELL | 70 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 tests/scripts/targets/ONESHELL 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; -- 2.11.4.GIT