VirtualBox

source: kBuild/trunk/src/kmk/tests/scripts/variables/special@ 3532

Last change on this file since 3532 was 3140, checked in by bird, 7 years ago

kmk: Merged in changes from GNU make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6 / https://git.savannah.gnu.org/git/make.git).

  • Property svn:eol-style set to LF
File size: 2.6 KB
Line 
1# -*-perl-*-
2
3$description = "Test special GNU make variables.";
4
5$details = "";
6
7&run_make_test('
8
9X1 := $(sort $(filter FOO BAR,$(.VARIABLES)))
10
11FOO := foo
12
13X2 := $(sort $(filter FOO BAR,$(.VARIABLES)))
14
15BAR := bar
16
17all: ; @echo X1 = $(X1); echo X2 = $(X2); echo LAST = $(sort $(filter FOO BAR,$(.VARIABLES)))
18',
19 '', "X1 =\nX2 = FOO\nLAST = BAR FOO\n");
20
21# SV 45728: Test that undefining a variable is reflected properly
22
23&run_make_test('
24FOO := foo
25BAR := bar
26$(info one: $(sort $(filter FOO BAR BAZ,$(.VARIABLES))))
27undefine BAR
28BAZ := baz
29$(info two: $(sort $(filter FOO BAR BAZ,$(.VARIABLES))))
30all:;@:
31',
32 '', "one: BAR FOO\ntwo: BAZ FOO\n");
33
34# $makefile2 = &get_tmpfile;
35# open(MAKEFILE, "> $makefile2");
36
37# print MAKEFILE <<'EOF';
38
39# X1 := $(sort $(.TARGETS))
40
41# all: foo
42# @echo X1 = $(X1)
43# @echo X2 = $(X2)
44# @echo LAST = $(sort $(.TARGETS))
45
46# X2 := $(sort $(.TARGETS))
47
48# foo:
49
50# EOF
51
52# close(MAKEFILE);
53
54# # TEST #2
55# # -------
56
57# &run_make_with_options($makefile2, "", &get_logfile);
58# $answer = "X1 =\nX2 = all\nLAST = all foo\n";
59# &compare_output($answer, &get_logfile(1));
60
61# Test the .RECIPEPREFIX variable
62# kmk: This test isn't -j1 safe, haven't bother looking into why yet.
63&run_make_test('
64define foo
65: foo-one\
66foo-two
67: foo-three
68 : foo-four
69endef
70
71orig: ; : orig-one
72 : orig-two \
73orig-three \
74 orig-four \
75 orig-five \\\\
76 : orig-six
77 $(foo)
78
79.RECIPEPREFIX = >
80test: ; : test-one
81>: test-two \
82test-three \
83>test-four \
84> test-five \\\\
85>: test-six
86>$(foo)
87
88.RECIPEPREFIX =
89reset: ; : reset-one
90 : reset-two \
91reset-three \
92 reset-four \
93 reset-five \\\\
94 : reset-six
95 $(foo)
96',
97 '-j1 orig test reset',
98 ': orig-one
99: orig-two \
100orig-three \
101orig-four \
102 orig-five \\\\
103: orig-six
104: foo-one foo-two
105: foo-three
106: foo-four
107: test-one
108: test-two \
109test-three \
110test-four \
111 test-five \\\\
112: test-six
113: foo-one foo-two
114: foo-three
115: foo-four
116: reset-one
117: reset-two \
118reset-three \
119reset-four \
120 reset-five \\\\
121: reset-six
122: foo-one foo-two
123: foo-three
124: foo-four');
125
126# Test that the "did you mean TAB" message is printed properly
127
128run_make_test(q!
129$x.
130!,
131 '', '#MAKEFILE#:2: *** missing separator. Stop.', 512);
132
133run_make_test(q!
134foo:
135 bar
136!,
137 '', '#MAKEFILE#:3: *** missing separator (did you mean TAB instead of 8 spaces?). Stop.', 512);
138
139run_make_test(q!
140.RECIPEPREFIX = :
141foo:
142 bar
143!,
144 '', '#MAKEFILE#:4: *** missing separator. Stop.', 512);
145
1461;
147
148### Local Variables:
149### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
150### End:
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette