VirtualBox

source: kBuild/branches/GNU/src/gmake/tests/scripts/variables/flavors@ 54

Last change on this file since 54 was 53, checked in by bird, 21 years ago

Initial revision

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
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;
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