Fix Savannah bug #106: keep separate track of which variable we are
[make.git] / tests / scripts / options / warn-undefined-variables
blob34bfaea4e260f1800f3842d45185e664761b8aa0
1 #                                                                    -*-perl-*-
3 $description = "Test the --warn-undefined-variables option.";
5 $details = "Verify that warnings are printed for referencing undefined variables.";
7 # Without --warn-undefined-variables, nothing should happen
8 run_make_test('
9 EMPTY =
10 EREF = $(EMPTY)
11 UREF = $(UNDEFINED)
13 SEREF := $(EREF)
14 SUREF := $(UREF)
16 all: ; @echo ref $(EREF) $(UREF)',
17               '', 'ref');
19 # With --warn-undefined-variables, it should warn me
20 run_make_test(undef, '--warn-undefined-variables',
21               "#MAKEFILE#:7: warning: undefined variable `UNDEFINED'
22 #MAKEFILE#:9: warning: undefined variable `UNDEFINED'
23 ref");