Changeset 284 in kBuild for branches/GNU/src/gmake/tests/scripts/variables
- Timestamp:
- May 16, 2005 4:54:08 PM (20 years ago)
- Location:
- branches/GNU/src/gmake/tests/scripts/variables
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gmake/tests/scripts/variables/MAKE
r53 r284 1 # -*-perl-*- 2 1 3 $description = "The following test creates a makefile to test MAKE \n" 2 4 ."(very generic)"; … … 27 29 &run_make_with_options($makefile,"",&get_logfile,0); 28 30 29 & delete("foo");31 &rmfiles("foo"); 30 32 # COMPARE RESULTS 31 33 &compare_output($answer,&get_logfile(1)); -
branches/GNU/src/gmake/tests/scripts/variables/MAKELEVEL
r53 r284 1 # -*-perl-mode-*-1 # -*-perl-*- 2 2 3 3 $description = "The following test creates a makefile to test … … 10 10 11 11 print MAKEFILE <<EOF; 12 SHELL = /bin/sh13 12 all: 14 13 \t\@echo MAKELEVEL is \$(MAKELEVEL) -
branches/GNU/src/gmake/tests/scripts/variables/automatic
r53 r284 68 68 69 69 &run_make_with_options($makefile2, "$dir/foo $dir/bar", &get_logfile); 70 $answer = ".x\n$dir/foo.x\n \$.x\n\[email protected]\n$dir.x\nfoo.x\n$dir/bar.x\nbar.x\n";70 $answer = ".x\n$dir/foo.x\nx\n\[email protected]\n$dir.x\nfoo.x\n$dir/bar.x\nbar.x\n"; 71 71 &compare_output($answer, &get_logfile(1)); 72 72 73 73 &run_make_with_options($makefile2, "$dir/x.z $dir/y.z", &get_logfile); 74 $answer = ".x\n$dir/x.z.x\n \$.x\n\[email protected]\n$dir.x\nx.z.x\n.y\n$dir/y.z.y\n\$.y\n\[email protected]\n$dir.y\ny.z.y\n";74 $answer = ".x\n$dir/x.z.x\nx\n\[email protected]\n$dir.x\nx.z.x\n.y\n$dir/y.z.y\n\y\n\[email protected]\n$dir.y\ny.z.y\n"; 75 75 &compare_output($answer, &get_logfile(1)); 76 76 … … 79 79 &compare_output($answer, &get_logfile(1)); 80 80 81 # TEST #3 -- test for Savannah bug #12320. 82 # 83 run_make_test(' 84 .SUFFIXES: .b .src 85 86 mbr.b: mbr.src 87 @echo $* 88 89 mbr.src: ; @: 90 91 ', 92 '', 93 'mbr 94 '); 95 81 96 1; -
branches/GNU/src/gmake/tests/scripts/variables/flavors
r53 r284 72 72 73 73 &run_make_with_options($makefile, "BOGUS=true", &get_logfile, 512); 74 $answer = "$makefile:2 3: *** empty variable name. Stop.\n";74 $answer = "$makefile:24: *** empty variable name. Stop.\n"; 75 75 &compare_output($answer, &get_logfile(1)); 76 76 … … 82 82 &compare_output($answer, &get_logfile(1)); 83 83 84 # Clean up from "old style" testing. If all the above tests are converted to 85 # run_make_test() syntax than this line can be removed. 86 $makefile = undef; 87 88 # ------------------------- 89 # Make sure that prefix characters apply properly to define/endef values. 90 # 91 # There's a bit of oddness here if you try to use a variable to hold the 92 # prefix character for a define. Even though something like this: 93 # 94 # define foo 95 # echo bar 96 # endef 97 # 98 # all: ; $(V)$(foo) 99 # 100 # (where V=@) can be seen by the user to be obviously different than this: 101 # 102 # define foo 103 # $(V)echo bar 104 # endef 105 # 106 # all: ; $(foo) 107 # 108 # and the user thinks it should behave the same as when the "@" is literal 109 # instead of in a variable, that can't happen because by the time make 110 # expands the variables for the command line and sees it begins with a "@" it 111 # can't know anymore whether the prefix character came before the variable 112 # reference or was included in the first line of the variable reference. 113 114 # TEST #5 115 # ------- 116 117 run_make_test(' 118 define FOO 119 $(V1)echo hello 120 $(V2)echo world 121 endef 122 all: ; @$(FOO) 123 ', '', 'hello 124 world'); 125 126 # TEST #6 127 # ------- 128 129 run_make_test(undef, 'V1=@ V2=@', 'hello 130 world'); 131 132 # TEST #7 133 # ------- 134 135 run_make_test(' 136 define FOO 137 $(V1)echo hello 138 $(V2)echo world 139 endef 140 all: ; $(FOO) 141 ', 'V1=@', 'hello 142 echo world 143 world'); 144 145 # TEST #8 146 # ------- 147 148 run_make_test(undef, 'V2=@', 'echo hello 149 hello 150 world'); 151 152 # TEST #9 153 # ------- 154 155 run_make_test(undef, 'V1=@ V2=@', 'hello 156 world'); 157 158 # TEST #10 159 # ------- 160 # Test the basics; a "@" internally to the variable applies to only one line. 161 # A "@" before the variable applies to the entire variable. 162 163 run_make_test(' 164 define FOO 165 @echo hello 166 echo world 167 endef 168 define BAR 169 echo hello 170 echo world 171 endef 172 173 all: foo bar 174 foo: ; $(FOO) 175 bar: ; @$(BAR) 176 ', '', 'hello 177 echo world 178 world 179 hello 180 world 181 '); 84 182 85 183 1; -
branches/GNU/src/gmake/tests/scripts/variables/special
r53 r284 5 5 $details = ""; 6 6 7 $makefile2 = &get_tmpfile; 8 9 10 open(MAKEFILE, "> $makefile"); 11 12 print MAKEFILE <<'EOF'; 7 &run_make_test(' 13 8 14 9 X1 := $(sort $(filter FOO BAR,$(.VARIABLES))) … … 24 19 @echo X2 = $(X2) 25 20 @echo LAST = $(sort $(filter FOO BAR,$(.VARIABLES))) 26 27 EOF 28 29 close(MAKEFILE); 30 31 # TEST #1 32 # ------- 33 34 &run_make_with_options($makefile, "", &get_logfile); 35 $answer = "X1 =\nX2 = FOO\nLAST = BAR FOO\n"; 36 &compare_output($answer, &get_logfile(1)); 21 ', 22 '', "X1 =\nX2 = FOO\nLAST = BAR FOO\n"); 37 23 38 24 39 25 40 26 # $makefile2 = &get_tmpfile; 41 27 # open(MAKEFILE, "> $makefile2"); 42 28
Note:
See TracChangeset
for help on using the changeset viewer.