summaryrefslogtreecommitdiffstats
path: root/src/kmk/tests/scripts/variables/flavors
blob: ba133ea860d2fc204b3b75c54837da2e2dad328f (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#                                                                    -*-perl-*-

$description = "Test various flavors of make variable setting.";

$details = "";

# TEST 0: Recursive

run_make_test('
ugh = Goodbye
foo = $(bar)
bar = ${ugh}
ugh = Hello
all: ; @echo $(foo)
',
              '', "Hello\n");

# TEST 1: Simple

run_make_test('
bar = Goodbye
foo := $(bar)
bar = ${ugh}
ugh = Hello
all: ; @echo $(foo)
',
              '', "Goodbye\n");

# TEST 2: Append to recursive

run_make_test('
foo = Hello
ugh = Goodbye
foo += $(bar)
bar = ${ugh}
ugh = Hello
all: ; @echo $(foo)
',
              '', "Hello Hello\n");

# TEST 3: Append to simple

run_make_test('
foo := Hello
ugh = Goodbye
bar = ${ugh}
foo += $(bar)
ugh = Hello
all: ; @echo $(foo)
',
              '', "Hello Goodbye\n");

# TEST 4: Conditional pre-set

run_make_test('
foo = Hello
ugh = Goodbye
bar = ${ugh}
foo ?= $(bar)
ugh = Hello
all: ; @echo $(foo)
',
              '', "Hello\n");

# TEST 5: Conditional unset

run_make_test('
ugh = Goodbye
bar = ${ugh}
foo ?= $(bar)
ugh = Hello
all: ; @echo $(foo)
',
              '', "Hello\n");

# TEST 6: Simple using POSIX syntax
run_make_test('
bar = Goodbye
foo ::= $(bar)
bar = ${ugh}
ugh = Hello
all: ; @echo $(foo)
',
              '', "Goodbye\n");

# TEST 7: POSIX syntax no spaces
run_make_test('
bar = Goodbye
foo::=$(bar)
bar = ${ugh}
ugh = Hello
all: ; @echo $(foo)
',
              '', "Goodbye\n");

1;