VirtualBox

source: kBuild/trunk/src/kmk/tests/scripts/variables/undefine@ 2634

Last change on this file since 2634 was 2591, checked in by bird, 13 years ago

kmk: Merged in changes from GNU make 3.82. Previous GNU make base version was gnumake-2008-10-28-CVS.

File size: 955 bytes
Line 
1# -*-perl-*-
2
3$description = "Test variable undefine.";
4
5$details = "";
6
7# TEST 0: basic undefine functionality
8
9run_make_test('
10a = a
11b := b
12define c
13c
14endef
15
16$(info $(flavor a) $(flavor b) $(flavor c))
17
18n := b
19
20undefine a
21undefine $n
22undefine c
23
24$(info $(flavor a) $(flavor b) $(flavor c))
25
26
27all: ;@:
28',
29'', "recursive simple recursive\nundefined undefined undefined");
30
31
32# TEST 1: override
33
34run_make_test('
35undefine a
36override undefine b
37
38$(info $(flavor a) $(flavor b))
39
40
41all: ;@:
42',
43'a=a b=b', "recursive undefined");
44
451;
46
47# TEST 2: undefine in eval (make sure we undefine from the global var set)
48
49run_make_test('
50define undef
51$(eval undefine $$1)
52endef
53
54a := a
55$(call undef,a)
56$(info $(flavor a))
57
58
59all: ;@:
60',
61'', "undefined");
62
63
64# TEST 3: Missing variable name
65
66run_make_test('
67a =
68undefine $a
69all: ;@echo ouch
70',
71'', "#MAKEFILE#:3: *** empty variable name. Stop.\n", 512);
72
731;
Note: See TracBrowser for help on using the repository browser.

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