2010-07-12 05:29:25 +00:00
|
|
|
# -*-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
|
|
|
|
');
|
|
|
|
|
2012-03-03 22:56:20 +00:00
|
|
|
# Simple but use multi-word SHELLFLAGS
|
|
|
|
|
|
|
|
run_make_test(q!
|
|
|
|
.ONESHELL:
|
|
|
|
.SHELLFLAGS = -e -c
|
|
|
|
all:
|
|
|
|
a=$$$$
|
|
|
|
[ 0"$$a" -eq "$$$$" ] || echo fail
|
|
|
|
!,
|
|
|
|
'', 'a=$$
|
|
|
|
[ 0"$a" -eq "$$" ] || echo fail
|
|
|
|
');
|
|
|
|
|
2010-07-12 05:29:25 +00:00
|
|
|
# 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);
|
2010-07-19 07:10:53 +00:00
|
|
|
>print "a = $$a, y = (@y)\n";
|
2010-07-12 05:29:25 +00:00
|
|
|
!,
|
|
|
|
'', "a = 12, y = (a b c)\n");
|
|
|
|
|
|
|
|
1;
|