summaryrefslogtreecommitdiff
path: root/tests/scripts/misc
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2005-06-25 21:30:13 +0000
committerPaul Smith <psmith@gnu.org>2005-06-25 21:30:13 +0000
commit6cdaff0948bbec3220d5cb071f79d5f2e1c9b083 (patch)
tree407efa2f97b6dfb472fb96396d6fa73892f38a97 /tests/scripts/misc
parent1dd9ed1c0537cb2583e1de8367994560ad1470aa (diff)
downloadgunmake-6cdaff0948bbec3220d5cb071f79d5f2e1c9b083.tar.gz
Fix Savannah bug #1454: skip over semicolons (and comments) inside variable
references in target definition lines.
Diffstat (limited to 'tests/scripts/misc')
-rw-r--r--tests/scripts/misc/general332
1 files changed, 15 insertions, 17 deletions
diff --git a/tests/scripts/misc/general3 b/tests/scripts/misc/general3
index 2421ed4..40b7ed9 100644
--- a/tests/scripts/misc/general3
+++ b/tests/scripts/misc/general3
@@ -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;