summaryrefslogtreecommitdiff
path: root/tests/scripts/options/eval
blob: 0f824090a11e40864d0d74973d24ac5502adcbd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#                                                                    -*-perl-*-

$description = "Test the --eval option.";

$details = "Verify that --eval options take effect,
and are passed to sub-makes.";

# Verify that --eval is evaluated first
run_make_test(q!
BAR = bar
all: ; @echo all
recurse: ; @$(MAKE) -f #MAKEFILE# && echo recurse!,
              '--eval=\$\(info\ eval\) FOO=\$\(BAR\)', "eval\nall");

# Make sure that --eval is handled correctly during recursion
run_make_test(undef, '--no-print-directory --eval=\$\(info\ eval\) recurse',
              "eval\neval\nall\nrecurse");

# Make sure that --eval is handled correctly during restarting
run_make_test(q!
all: ; @echo $@
-include gen.mk
gen.mk: ; @echo > $@
!,
              '--eval=\$\(info\ eval\)', "eval\neval\nall");

unlink('gen.mk');

1;