Debian Codegraph @

tests/scripts/options/eval

raw
1 # -*-perl-*-
2
3 $description = "Test the --eval option.";
4
5 $details = "Verify that --eval options take effect,
6 and are passed to sub-makes.";
7
8 # Verify that --eval is evaluated first
9 run_make_test(q!
10 $(info infile)
11 BAR = bar
12 all: ; @echo all
13 recurse: ; @$(MAKE) -f #MAKEFILE# && echo recurse!,
14 ['--eval=$(info eval)', 'FOO=$(BAR)'], "eval\ninfile\nall");
15
16 # Make sure that --eval is handled correctly during recursion
17 run_make_test(undef, ['--no-print-directory', '--eval=$(info eval)', 'recurse'],
18 "eval\ninfile\neval\ninfile\nall\nrecurse");
19
20 # Make sure that --eval is not passed in MAKEFLAGS
21 run_make_test(q!
22 all: ; @echo "MAKEFLAGS=$$MAKEFLAGS"
23 !,
24 ['--eval=$(info eval)'],
25 "eval\n".'MAKEFLAGS= --eval=$$(info\ eval)');
26
27 # Make sure that --eval is handled correctly during restarting
28 run_make_test(q!
29 all: ; @echo $@
30 -include gen.mk
31 gen.mk: ; @echo > $@
32 !,
33 ['--eval=$(info eval)'], "eval\neval\nall");
34
35 unlink('gen.mk');
36
37 # Check -E
38 run_make_test(q!
39 BAR = bar
40 all: ; @echo all
41 recurse: ; @$(MAKE) -f #MAKEFILE# && echo recurse!,
42 ['-E', '$(info eval)', 'FOO=$(BAR)'], "eval\nall");
43
44 1;