VirtualBox

source: kBuild/trunk/src/gmake/tests/scripts/variables/flavors@ 53

最後變更 在這個檔案從53是 53,由 bird 提交於 21 年 前

Initial revision

  • 屬性 svn:eol-style 設為 native
檔案大小: 1.3 KB
 
1# -*-perl-*-
2
3$description = "Test various flavors of make variable setting.";
4
5$details = "";
6
7open(MAKEFILE, "> $makefile");
8
9# The Contents of the MAKEFILE ...
10
11print MAKEFILE <<'EOF';
12foo = $(bar)
13bar = ${ugh}
14ugh = Hello
15
16all: multi ; @echo $(foo)
17
18multi: ; $(multi)
19
20x := foo
21y := $(x) bar
22x := later
23
24nullstring :=
25space := $(nullstring) $(nullstring)
26
27next: ; @echo $x$(space)$y
28
29define multi
30@echo hi
31echo there
32endef
33
34ifdef BOGUS
35define
36@echo error
37endef
38endif
39
40define outer
41 define inner
42 A = B
43 endef
44endef
45
46$(eval $(outer))
47
48outer: ; @echo $(inner)
49
50EOF
51
52# END of Contents of MAKEFILE
53
54close(MAKEFILE);
55
56# TEST #1
57# -------
58
59&run_make_with_options($makefile, "", &get_logfile);
60$answer = "hi\necho there\nthere\nHello\n";
61&compare_output($answer, &get_logfile(1));
62
63# TEST #2
64# -------
65
66&run_make_with_options($makefile, "next", &get_logfile);
67$answer = "later foo bar\n";
68&compare_output($answer, &get_logfile(1));
69
70# TEST #3
71# -------
72
73&run_make_with_options($makefile, "BOGUS=true", &get_logfile, 512);
74$answer = "$makefile:23: *** empty variable name. Stop.\n";
75&compare_output($answer, &get_logfile(1));
76
77# TEST #4
78# -------
79
80&run_make_with_options($makefile, "outer", &get_logfile);
81$answer = "A = B\n";
82&compare_output($answer, &get_logfile(1));
83
84
851;
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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