summaryrefslogtreecommitdiff
path: root/tests/scripts/variables
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2006-02-15 23:54:42 +0000
committerPaul Smith <psmith@gnu.org>2006-02-15 23:54:42 +0000
commit0806a403d65ef6a7f16e2c17aa8286100ebad5d7 (patch)
treeefb7503681a70739ad6e4659ebefc701975ced7f /tests/scripts/variables
parent86af3872a910e314d20ef911fad1819ad90c1291 (diff)
downloadgunmake-0806a403d65ef6a7f16e2c17aa8286100ebad5d7.tar.gz
Fix Savannah bug #106: keep separate track of which variable we are
expanding, and use that info when generating error messages instead of the file info, where appropriate.
Diffstat (limited to 'tests/scripts/variables')
-rw-r--r--tests/scripts/variables/negative46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/scripts/variables/negative b/tests/scripts/variables/negative
new file mode 100644
index 0000000..16a72b8
--- /dev/null
+++ b/tests/scripts/variables/negative
@@ -0,0 +1,46 @@
+# -*-perl-*-
+
+$description = "Run some negative tests (things that should fail).";
+
+# TEST #0
+# Check that non-terminated variable references are detected (and
+# reported using the best filename/lineno info
+run_make_test('
+foo = bar
+x = $(foo
+y = $x
+
+all: ; @echo $y
+',
+ '', '#MAKEFILE#:3: *** unterminated variable reference. Stop.',
+ 512);
+
+# TEST #1
+# Bogus variable value passed on the command line.
+run_make_test(undef,
+ 'x=\$\(other',
+ '#MAKEFILE#:4: *** unterminated variable reference. Stop.',
+ 512);
+
+# TEST #2
+# Again, but this time while reading the makefile.
+run_make_test('
+foo = bar
+x = $(foo
+y = $x
+
+z := $y
+
+all: ; @echo $y
+',
+ '', '#MAKEFILE#:3: *** unterminated variable reference. Stop.',
+ 512);
+
+# TEST #3
+# Bogus variable value passed on the command line.
+run_make_test(undef,
+ 'x=\$\(other',
+ '#MAKEFILE#:4: *** unterminated variable reference. Stop.',
+ 512);
+
+1;