From 0806a403d65ef6a7f16e2c17aa8286100ebad5d7 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Wed, 15 Feb 2006 23:54:42 +0000 Subject: 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. --- tests/scripts/options/warn-undefined-variables | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/scripts/options/warn-undefined-variables (limited to 'tests/scripts/options') diff --git a/tests/scripts/options/warn-undefined-variables b/tests/scripts/options/warn-undefined-variables new file mode 100644 index 0000000..34bfaea --- /dev/null +++ b/tests/scripts/options/warn-undefined-variables @@ -0,0 +1,25 @@ +# -*-perl-*- + +$description = "Test the --warn-undefined-variables option."; + +$details = "Verify that warnings are printed for referencing undefined variables."; + +# Without --warn-undefined-variables, nothing should happen +run_make_test(' +EMPTY = +EREF = $(EMPTY) +UREF = $(UNDEFINED) + +SEREF := $(EREF) +SUREF := $(UREF) + +all: ; @echo ref $(EREF) $(UREF)', + '', 'ref'); + +# With --warn-undefined-variables, it should warn me +run_make_test(undef, '--warn-undefined-variables', + "#MAKEFILE#:7: warning: undefined variable `UNDEFINED' +#MAKEFILE#:9: warning: undefined variable `UNDEFINED' +ref"); + +1; -- cgit v1.2.3