Fix Savannah bug #1454: skip over semicolons (and comments) inside variable

references in target definition lines.
This commit is contained in:
Paul Smith
2005-06-25 21:30:13 +00:00
parent 1dd9ed1c05
commit 6cdaff0948
6 changed files with 108 additions and 53 deletions

View File

@@ -5,13 +5,7 @@ This tests random features of the parser that need to be supported, and
which have either broken at some point in the past or seem likely to
break.";
$makefile2 = &get_tmpfile;
open(MAKEFILE,"> $makefile");
# The contents of the Makefile ...
print MAKEFILE <<EOF;
run_make_test("
# We want to allow both empty commands _and_ commands that resolve to empty.
EMPTY =
@@ -31,20 +25,15 @@ TAB = \t \# A TAB and some spaces
\$(STR)
\$(STR) \$(TAB)
EOF
close(MAKEFILE);
&run_make_with_options($makefile,"",&get_logfile);
$answer = "$make_name: Nothing to be done for `all'.\n";
&compare_output($answer,&get_logfile(1));
\$(STR) \$(TAB)",
'', "#MAKE#: Nothing to be done for `all'.");
# TEST 2
# Make sure files without trailing newlines are handled properly.
# Have to use the old style invocation to test this.
$makefile2 = &get_tmpfile;
open(MAKEFILE, "> $makefile2");
print MAKEFILE "all:;\@echo FOO = \$(FOO)\nFOO = foo";
@@ -54,5 +43,14 @@ close(MAKEFILE);
$answer = "FOO = foo\n";
&compare_output($answer,&get_logfile(1));
# TEST 3
# Check semicolons in variable references
run_make_test('
$(if true,$(info true; true))
all: ; @:
',
'', 'true; true');
1;