Changeset 2591 for trunk/src/kmk/tests/scripts/features
- Timestamp:
- Jun 17, 2012, 10:45:31 PM (13 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 15 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk
- Property svn:ignore
-
old new 13 13 stamp-* 14 14 makebook* 15 15 16 .*gdbinit 17 .gdb_history 18 16 19 *.dep 17 20 *.dvi … … 31 34 *.pg 32 35 *.pgs 36 33 37 README 34 38 README.DOS 35 39 README.W32 40 README.OS2 36 41 aclocal.m4 37 42 autom4te.cache … … 52 57 config.h.W32 53 58 config.h-vms 59 54 60 loadavg 55 61 loadavg.c 56 62 make 63 57 64 .deps 58 65 .dep_segment 66 ID 67 TAGS 68 59 69 _* 60 70 sun4 … … 72 82 sol2 73 83 i486-linux 84 74 85 customs 86 75 87 install-sh 76 88 mkinstalldirs 89 90 .directive.asc
-
- Property svn:ignore
-
trunk/src/kmk/tests
- Property svn:ignore
--- +++
- Property svn:ignore
-
trunk/src/kmk/tests/scripts/features/echoing
r969 r2591 1 $description = "The following test creates a makefile to test command \n" 2 ."echoing. It tests that when a command line starts with \n" 3 ."a '\@', the echoing of that line is suppressed. It also \n" 4 ."tests the -n option which tells make to ONLY echo the \n" 5 ."commands and no execution happens. In this case, even \n" 6 ."the commands with '\@' are printed. Lastly, it tests the \n" 7 ."-s flag which tells make to prevent all echoing, as if \n" 8 ."all commands started with a '\@'."; 1 # -*-perl-*- 2 $description = "The following test creates a makefile to test command 3 echoing. It tests that when a command line starts with 4 a '\@', the echoing of that line is suppressed. It also 5 tests the -n option which tells make to ONLY echo the 6 commands and no execution happens. In this case, even 7 the commands with '\@' are printed. Lastly, it tests the 8 -s flag which tells make to prevent all echoing, as if 9 all commands started with a '\@'."; 9 10 10 $details = "This test is similar to the 'clean' test except that a '\@' has \n"11 ."been placed in front of the delete command line. Four tests \n" 12 ."are run here. First, make is run normally and the first echo\n" 13 ."command should be executed. In this case there is no '\@' so \n" 14 ."we should expect make to display the command AND display the \n" 15 ."echoed message. Secondly, make is run with the clean target, \n" 16 ."but since there is a '\@' at the beginning of the command, we\n" 17 ."expect no output; just the deletion of a file which we check \n" 18 ."for. Third, we give the clean target again except this time\n" 19 ."we give make the -n option. We now expect the command to be \n" 20 ."displayed but not to be executed. In this case we need only \n" 21 ."to check the output since an error message would be displayed\n" 22 ."if it actually tried to run the delete command again and the \n" 23 ."file didn't exist. Lastly, we run the first test again with \n" 24 ."the -s option and check that make did not echo the echo \n" 25 ."command before printing the message.";11 $details = "This test is similar to the 'clean' test except that a '\@' has 12 been placed in front of the delete command line. Four tests 13 are run here. First, make is run normally and the first echo 14 command should be executed. In this case there is no '\@' so 15 we should expect make to display the command AND display the 16 echoed message. Secondly, make is run with the clean target, 17 but since there is a '\@' at the beginning of the command, we 18 expect no output; just the deletion of a file which we check 19 for. Third, we give the clean target again except this time 20 we give make the -n option. We now expect the command to be 21 displayed but not to be executed. In this case we need only 22 to check the output since an error message would be displayed 23 if it actually tried to run the delete command again and the 24 file didn't exist. Lastly, we run the first test again with 25 the -s option and check that make did not echo the echo 26 command before printing the message.\n"; 26 27 27 28 $example = "EXAMPLE_FILE"; 28 29 29 open(MAKEFILE,"> $makefile"); 30 31 # The Contents of the MAKEFILE ... 32 33 print MAKEFILE "all: \n"; 34 print MAKEFILE "\techo This makefile did not clean the dir... good\n"; 35 print MAKEFILE "clean: \n"; 36 print MAKEFILE "\t\@$delete_command $example\n"; 37 38 # END of Contents of MAKEFILE 39 40 close(MAKEFILE); 41 42 &touch($example); 30 touch($example); 43 31 44 32 # TEST #1 45 33 # ------- 46 34 47 &run_make_with_options($makefile,"",&get_logfile,0); 48 $answer = "echo This makefile did not clean the dir... good\n" 49 ."This makefile did not clean the dir... good\n"; 50 &compare_output($answer,&get_logfile(1)); 51 35 run_make_test(" 36 all: 37 \techo This makefile did not clean the dir... good 38 clean: 39 \t\@$delete_command $example\n", 40 '', 'echo This makefile did not clean the dir... good 41 This makefile did not clean the dir... good'); 52 42 53 43 # TEST #2 54 44 # ------- 55 45 56 &run_make_with_options($makefile,"clean",&get_logfile,0);46 run_make_test(undef, 'clean', ''); 57 47 if (-f $example) { 58 48 $test_passed = 0; 49 unlink($example); 59 50 } 60 &compare_output('',&get_logfile(1));61 51 62 52 # TEST #3 63 53 # ------- 64 54 65 &run_make_with_options($makefile,"-n clean",&get_logfile,0); 66 $answer = "$delete_command $example\n"; 67 &compare_output($answer,&get_logfile(1)); 55 run_make_test(undef, '-n clean', "$delete_command $example\n"); 68 56 69 57 … … 71 59 # ------- 72 60 73 &run_make_with_options($makefile,"-s",&get_logfile,0); 74 $answer = "This makefile did not clean the dir... good\n"; 75 &compare_output($answer,&get_logfile(1)); 61 run_make_test(undef, '-s', "This makefile did not clean the dir... good\n"); 76 62 77 63 78 64 1; 79 80 81 82 83 84 85 86 87 -
trunk/src/kmk/tests/scripts/features/export
r969 r2591 7 7 # about that here. 8 8 9 open(MAKEFILE,"> $makefile"); 10 11 # The Contents of the MAKEFILE ... 12 13 print MAKEFILE <<'EOMAKE'; 14 9 &run_make_test(' 15 10 FOO = foo 16 11 BAR = bar … … 41 36 @echo "FOO=$(FOO) BAR=$(BAR) BAZ=$(BAZ) BOZ=$(BOZ) BITZ=$(BITZ) BOTZ=$(BOTZ)" 42 37 @echo "FOO=$$FOO BAR=$$BAR BAZ=$$BAZ BOZ=$$BOZ BITZ=$$BITZ BOTZ=$$BOTZ" 43 44 EOMAKE 45 46 close(MAKEFILE); 47 48 # TEST 0: basics 49 50 &run_make_with_options($makefile,"",&get_logfile,0); 51 52 $answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz 53 FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n"; 54 55 &compare_output($answer,&get_logfile(1)); 38 ', 39 '', "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz 40 FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n"); 56 41 57 42 # TEST 1: make sure vars inherited from the parent are exported … … 59 44 $extraENV{FOO} = 1; 60 45 61 &run_make_with_options($makefile,"",&get_logfile,0); 62 63 $answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz 64 FOO=foo BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n"; 65 66 &compare_output($answer,&get_logfile(1)); 46 &run_make_test(undef, '', "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz 47 FOO=foo BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n"); 67 48 68 49 # TEST 2: global export. Explicit unexport takes precedence. 69 50 70 &run_make_with_options($makefile,"EXPORT_ALL=1",&get_logfile,0); 71 72 $answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz 73 FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n"; 74 75 &compare_output($answer,&get_logfile(1)); 51 run_make_test(undef, "EXPORT_ALL=1" , 52 "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz 53 FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n"); 76 54 77 55 # TEST 3: global unexport. Explicit export takes precedence. 78 56 79 &run_make_with_options($makefile,"UNEXPORT_ALL=1",&get_logfile,0); 80 81 $answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz 82 FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n"; 83 84 &compare_output($answer,&get_logfile(1)); 57 &run_make_test(undef, "UNEXPORT_ALL=1", 58 "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz 59 FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n"); 85 60 86 61 # TEST 4: both: in the above makefile the unexport comes last so that rules. 87 62 88 &run_make_with_options($makefile,"EXPORT_ALL=1 UNEXPORT_ALL=1",&get_logfile,0); 89 90 $answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz 91 FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n"; 92 93 &compare_output($answer,&get_logfile(1)); 63 &run_make_test(undef, "EXPORT_ALL=1 UNEXPORT_ALL=1", 64 "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz 65 FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n"); 94 66 95 67 # TEST 5: test the pseudo target. 96 68 97 &run_make_with_options($makefile,"EXPORT_ALL_PSEUDO=1",&get_logfile,0); 98 99 $answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz 100 FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n"; 101 102 &compare_output($answer,&get_logfile(1)); 103 69 &run_make_test(undef, "EXPORT_ALL_PSEUDO=1", 70 "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz 71 FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n"); 104 72 105 73 # TEST 6: Test the expansion of variables inside export 106 74 107 $makefile2 = &get_tmpfile; 108 109 open(MAKEFILE, "> $makefile2"); 110 111 print MAKEFILE <<'EOF'; 112 75 &run_make_test(' 113 76 foo = f-ok 114 77 bar = b-ok … … 126 89 @echo foo=$(foo) bar=$(bar) 127 90 @echo foo=$$foo bar=$$bar 128 129 EOF 130 131 close(MAKEFILE); 132 133 &run_make_with_options($makefile2,"",&get_logfile,0); 134 $answer = "foo=f-ok bar=b-ok\nfoo=f-ok bar=b-ok\n"; 135 &compare_output($answer,&get_logfile(1)); 136 91 ', 92 "", "foo=f-ok bar=b-ok\nfoo=f-ok bar=b-ok\n"); 137 93 138 94 # TEST 7: Test the expansion of variables inside unexport 139 95 140 $makefile3 = &get_tmpfile; 141 142 open(MAKEFILE, "> $makefile3"); 143 144 print MAKEFILE <<'EOF'; 145 96 &run_make_test(' 146 97 foo = f-ok 147 98 bar = b-ok … … 161 112 @echo foo=$(foo) bar=$(bar) 162 113 @echo foo=$$foo bar=$$bar 163 164 EOF 165 166 close(MAKEFILE); 167 168 &run_make_with_options($makefile3,"",&get_logfile,0); 169 $answer = "foo=f-ok bar=b-ok\nfoo= bar=\n"; 170 &compare_output($answer,&get_logfile(1)); 171 114 ', 115 '', "foo=f-ok bar=b-ok\nfoo= bar=\n"); 172 116 173 117 # TEST 7: Test exporting multiple variables on the same line 174 118 175 $makefile4 = &get_tmpfile; 176 177 open(MAKEFILE, "> $makefile4"); 178 179 print MAKEFILE <<'EOF'; 180 119 &run_make_test(' 181 120 A = a 182 121 B = b … … 197 136 198 137 all: ; @echo A=$$A B=$$B C=$$C D=$$D E=$$E F=$$F G=$$G H=$$H I=$$I J=$$J 199 EOF 200 201 close(MAKEFILE); 202 203 &run_make_with_options($makefile4,"",&get_logfile,0); 204 $answer = "A=a B=b C=c D=d E=e F=f G=g H=h I=i J=j\n"; 205 &compare_output($answer,&get_logfile(1)); 206 138 ', 139 '', "A=a B=b C=c D=d E=e F=f G=g H=h I=i J=j\n"); 207 140 208 141 # TEST 8: Test unexporting multiple variables on the same line 209 142 210 $makefile5 = &get_tmpfile;143 @extraENV{qw(A B C D E F G H I J)} = qw(1 2 3 4 5 6 7 8 9 10); 211 144 212 open(MAKEFILE, "> $makefile5"); 213 214 print MAKEFILE <<'EOF'; 215 145 &run_make_test(' 216 146 A = a 217 147 B = b … … 232 162 233 163 all: ; @echo A=$$A B=$$B C=$$C D=$$D E=$$E F=$$F G=$$G H=$$H I=$$I J=$$J 234 EOF 164 ', 165 '', "A= B= C= D= E= F= G= H= I= J=\n"); 235 166 236 close(MAKEFILE); 167 # TEST 9: Check setting a variable named "export" 237 168 238 @extraENV{qw(A B C D E F G H I J)} = qw(1 2 3 4 5 6 7 8 9 10); 169 &run_make_test(' 170 export = 123 171 export export 172 export export = 456 173 a: ; @echo "\$$(export)=$(export) / \$$export=$$export" 174 ', 175 '', "\$(export)=456 / \$export=456\n"); 239 176 240 &run_make_with_options($makefile5,"",&get_logfile,0); 241 $answer = "A= B= C= D= E= F= G= H= I= J=\n"; 242 &compare_output($answer,&get_logfile(1)); 177 # TEST 9: Check "export" as a target 243 178 179 &run_make_test(' 180 a: export 181 export: ; @echo "$@" 182 ', 183 '', "export\n"); 244 184 245 185 # This tells the test driver that the perl test script executed properly. -
trunk/src/kmk/tests/scripts/features/include
r969 r2591 91 91 ', '', ''); 92 92 93 1;94 95 93 96 94 # Make sure that we don't die when the command fails but we dontcare. … … 118 116 sinclude', '', ''); 119 117 118 119 # Test that the diagnostics is issued even if the target has been 120 # tried before with the dontcare flag (direct dependency case). 121 # 122 run_make_test(' 123 -include foo 124 125 all: bar 126 127 foo: baz 128 bar: baz 129 ', 130 '', 131 "#MAKE#: *** No rule to make target `baz', needed by `bar'. Stop.\n", 132 512); 133 134 # Test that the diagnostics is issued even if the target has been 135 # tried before with the dontcare flag (indirect dependency case). 136 # 137 run_make_test(' 138 -include foo 139 140 all: bar 141 142 foo: baz 143 bar: baz 144 baz: end 145 ', 146 '', 147 "#MAKE#: *** No rule to make target `end', needed by `baz'. Stop.\n", 148 512); 149 150 # Test that the diagnostics is issued even if the target has been 151 # tried before with the dontcare flag (include/-include case). 152 # 153 run_make_test(' 154 include bar 155 -include foo 156 157 all: 158 159 foo: baz 160 bar: baz 161 baz: end 162 ', 163 '', 164 "#MAKEFILE#:2: bar: No such file or directory 165 #MAKE#: *** No rule to make target `end', needed by `baz'. Stop.\n", 166 512); 167 168 if ($all_tests) { 169 # Test that include of a rebuild-able file doesn't show a warning 170 # Savannah bug #102 171 run_make_test(q! 172 include foo 173 foo: ; @echo foo = bar > $@ 174 !, 175 '', "#MAKE#: `foo' is up to date.\n"); 176 rmfiles('foo'); 177 } 178 120 179 1; -
trunk/src/kmk/tests/scripts/features/override
r969 r2591 1 $description = "The following test creates a makefile to ..."; 1 # -*-perl-*- 2 3 $description = "Test the override directive on variable assignments."; 2 4 3 5 $details = ""; 4 6 5 open(MAKEFILE,"> $makefile"); 7 # TEST 0: Basic override 6 8 7 # The Contents of the MAKEFILE ... 9 run_make_test(' 10 X = start 11 override recur = $(X) 12 override simple := $(X) 13 X = end 14 all: ; @echo "$(recur) $(simple)" 15 ', 16 'recur=I simple=J', "end start\n"); 8 17 9 print MAKEFILE "override define foo\n" 10 ."\@echo First comes the definition.\n" 11 ."\@echo Then comes the override.\n" 12 ."endef\n" 13 ."all: \n" 14 ."\t\$(foo)\n"; 18 # TEST 1: Override with append 15 19 16 # END of Contents of MAKEFILE 20 run_make_test(' 21 X += X1 22 override X += X2 23 override Y += Y1 24 Y += Y2 25 all: ; @echo "$(X) $(Y)" 26 ', 27 '', "X1 X2 Y1\n"); 17 28 18 close(MAKEFILE); 29 # TEST 2: Override with append to the command line 19 30 20 &run_make_with_options($makefile,"foo=Hello",&get_logfile);31 run_make_test(undef, 'X=C Y=C', "C X2 C Y1\n"); 21 32 22 # Create the answer to what should be produced by this Makefile 23 $answer = "First comes the definition.\n" 24 ."Then comes the override.\n"; 33 # Test override of define/endef 25 34 26 &compare_output($answer,&get_logfile(1)); 35 run_make_test(' 36 override define foo 37 @echo First comes the definition. 38 @echo Then comes the override. 39 endef 40 all: ; $(foo) 41 ', 42 'foo=Hello', "First comes the definition.\nThen comes the override.\n"); 43 27 44 28 45 1; 29 30 31 32 33 34 -
trunk/src/kmk/tests/scripts/features/parallelism
r2186 r2591 44 44 "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n"); 45 45 46 unlink('1.inc', '2.inc');46 rmfiles(qw(1.inc 2.inc)); 47 47 48 48 … … 63 63 "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n"); 64 64 65 unlink('1.inc', '2.inc');65 rmfiles(qw(1.inc 2.inc)); 66 66 67 67 # Grant Taylor reports a problem where tokens can be lost (not written back … … 153 153 .PHONY: phony 154 154 phony: ; : phony', '-rR -j', ': phony'); 155 unlink('target'); 156 155 rmfiles('target'); 156 157 # TEST #10: Don't put --jobserver-fds into a re-exec'd MAKEFLAGS. 158 # We can't test this directly because there's no way a makefile can 159 # show the value of MAKEFLAGS we were re-exec'd with. We can intuit it 160 # by looking for "disabling jobserver mode" warnings; we should only 161 # get one from the original invocation and none from the re-exec. 162 # See Savannah bug #18124 163 164 run_make_test(q! 165 -include inc.mk 166 recur: 167 # @echo 'MAKEFLAGS = $(MAKEFLAGS)' 168 @rm -f inc.mk 169 @$(MAKE) -j2 -f #MAKEFILE# all 170 all: 171 # @echo 'MAKEFLAGS = $(MAKEFLAGS)' 172 @echo $@ 173 inc.mk: 174 # @echo 'MAKEFLAGS = $(MAKEFLAGS)' 175 @echo 'FOO = bar' > $@ 176 !, 177 '--no-print-directory -j2', "#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.\nall\n"); 178 179 rmfiles('inc.mk'); 180 181 if ($all_tests) { 182 # Implicit files aren't properly recreated during parallel builds 183 # Savannah bug #26864 184 185 # The first run works fine 186 run_make_test(q! 187 %.bar: %.x foo.y ; cat $^ > $@ 188 %.x: ; touch $@ 189 foo.y: foo.y.in ; cp $< $@ 190 foo.y.in: ; touch $@ 191 !, 192 '-j2 main.bar', 193 "touch foo.y.in 194 touch main.x 195 cp foo.y.in foo.y 196 cat main.x foo.y > main.bar 197 rm main.x"); 198 199 # Now we touch the .in file and make sure it still works 200 touch('foo.y.in'); 201 202 run_make_test(undef, '-j2 main.bar', "cp foo.y.in foo.y 203 touch main.x 204 cat main.x foo.y > main.bar 205 rm main.x"); 206 207 # Clean up 208 rmfiles(qw(foo.y foo.y.in main.bar)); 209 } 210 211 if ($all_tests) { 212 # Jobserver FD handling is messed up in some way. 213 # Savannah bug #28189 214 # It doesn't look like that bug anymore but this is the code it runs 215 216 run_make_test(q! 217 ifdef EXTRA 218 vpath %.dst / 219 xxx.dst: ; true 220 yyy.dst: ; true 221 endif 222 223 M := $(MAKE) 224 xx: ; $M --no-print-directory -j2 -f $(MAKEFILE_LIST) xxx.dst yyy.dst EXTRA=1 225 !, 226 '-j2', 227 '#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode. 228 true 229 true 230 '); 231 } 157 232 158 233 # Make sure that all jobserver FDs are closed if we need to re-exec the … … 183 258 # 'bar'); 184 259 185 # unlink('dependfile', 'output');260 # rmfiles(qw(dependfile output)); 186 261 187 262 … … 189 264 # run_make_test(undef, '-j2 recurse INCL=false', 'bar'); 190 265 191 # unlink('dependfile', 'output');266 # rmfiles(qw(dependfile output)); 192 267 193 268 1; -
trunk/src/kmk/tests/scripts/features/patspecific_vars
r2173 r2591 121 121 pattrn: global: new $t pattern: good $t inherit: good $t;'); 122 122 123 # TEST #8: override in pattern-specific variables 124 125 run_make_test(' 126 a%: override FOO += f1 127 a%: FOO += f2 128 ab: ; @echo "$(FOO)" 129 ', 130 '', "f1\n"); 131 132 run_make_test(undef, 'FOO=C', "C f1\n"); 133 134 # TEST #9: Test shortest stem selection in pattern-specific variables. 135 136 run_make_test(' 137 %-mt.x: x := two 138 %.x: x := one 139 140 all: foo.x foo-mt.x 141 142 foo.x: ;@echo $x 143 foo-mt.x: ;@echo $x 144 ', 145 '', 146 "one\ntwo"); 123 147 124 148 1; -
trunk/src/kmk/tests/scripts/features/patternrules
- Property svn:keywords deleted
r1952 r2591 16 16 # 17 17 18 run_make_test( '18 run_make_test(q! 19 19 .PHONY: all 20 20 21 21 all: case.1 case.2 case.3 22 a: void 22 23 # We can't have this, due to "Implicit Rule Search Algorithm" step 5c 24 #xxx: void 23 25 24 26 # 1 - existing file … … 42 44 43 45 3.implicit-phony: 44 ', 45 '', 46 ''); 46 !, '', ''); 47 47 48 48 # TEST #1: make sure files that are built via implicit rules are marked … … 150 150 unlink('foo.in', 'foo.h', 'foo.c', 'foo.o'); 151 151 152 # TEST #5: make sure both prefix and suffix patterns work with multiple 153 # target patterns (Savannah bug #26593). 154 # 155 run_make_test(' 156 all: foo.s1 foo.s2 p1.foo p2.foo 157 158 p1.% p2.%: %.orig 159 @echo $@ 160 %.s1 %.s2: %.orig 161 @echo $@ 162 163 .PHONY: foo.orig 164 ', 165 '', "foo.s1\np1.foo\n"); 166 167 # TEST 6: Make sure that non-target files are still eligible to be created 168 # as part of implicit rule chaining. Savannah bug #17752. 169 170 run_make_test(q! 171 BIN = xyz 172 COPY = $(BIN).cp 173 SRC = $(BIN).c 174 allbroken: $(COPY) $(BIN) ; @echo ok 175 $(SRC): ; @echo 'main(){}' > $@ 176 %.cp: % ; @cp $< $@ 177 % : %.c ; @cp $< $@ 178 clean: ; @rm -rf $(SRC) $(COPY) $(BIN) 179 !, 180 '', "ok\n"); 181 182 unlink(qw(xyz xyz.cp xyz.c)); 183 184 # TEST 7: Make sure that all prereqs of all "also_make" targets get created 185 # before any of the things that depend on any of them. Savannah bug #19108. 186 187 run_make_test(q! 188 final: x ; @echo $@ 189 x: x.t1 x.t2 ; @echo $@ 190 x.t2: dep 191 dep: ; @echo $@ 192 %.t1 %.t2: ; @echo $*.t1 ; echo $*.t2 193 !, 194 '', "dep\nx.t1\nx.t2\nx\nfinal\n"); 195 196 197 # TEST 8: Verify we can remove pattern rules. Savannah bug #18622. 198 199 my @f = (qw(foo.w foo.ch)); 200 touch(@f); 201 202 run_make_test(q! 203 CWEAVE := : 204 205 # Disable builtin rules 206 %.tex : %.w 207 %.tex : %.w %.ch 208 !, 209 'foo.tex', 210 "#MAKE#: *** No rule to make target `foo.tex'. Stop.", 512); 211 212 unlink(@f); 213 214 # TEST #9: Test shortest stem selection in pattern rules. 215 216 run_make_test(' 217 %.x: ;@echo one 218 %-mt.x: ;@echo two 219 220 all: foo.x foo-mt.x 221 ', 222 '', 223 "one\ntwo"); 224 225 1; 226 152 227 # This tells the test driver that the perl test script executed properly. 153 228 1; -
trunk/src/kmk/tests/scripts/features/recursion
r1956 r2591 17 17 @echo THE END 18 18 ', 19 ('CFLAGS=-O -w' . ($parallel_jobs ? ' -j 2' : '')),19 ('CFLAGS=-O -w' . ($parallel_jobs ? ' -j 2' : '')), 20 20 ($vos 21 21 ? "#MAKE#: Entering directory `#PWD#' -
trunk/src/kmk/tests/scripts/features/se_explicit
- Property svn:keywords deleted
r1981 r2591 27 27 # TEST #1: automatic variables. 28 28 # 29 run_make_test( '29 run_make_test(q! 30 30 .SECONDEXPANSION: 31 .DEFAULT: ; @echo $@31 .DEFAULT: ; @echo '$@' 32 32 33 33 foo: bar baz … … 42 42 $$*.6 43 43 44 ',44 !, 45 45 '-j1', 46 46 'bar … … 63 63 # Test #2: target/pattern -specific variables. 64 64 # 65 run_make_test( '65 run_make_test(q! 66 66 .SECONDEXPANSION: 67 .DEFAULT: ; @echo $@67 .DEFAULT: ; @echo '$@' 68 68 69 69 foo.x: $$a $$b … … 72 72 73 73 %.x: b := baz 74 75 ', 74 !, 76 75 '', 77 76 'bar … … 82 81 # Test #3: order of prerequisites. 83 82 # 84 run_make_test( '83 run_make_test(q! 85 84 .SECONDEXPANSION: 86 .DEFAULT: ; @echo $@85 .DEFAULT: ; @echo '$@' 87 86 88 87 all: foo bar baz 89 88 90 89 # Subtest #1 91 #92 90 foo: foo.1; @: 93 94 91 foo: foo.2 95 96 92 foo: foo.3 97 93 98 99 94 # Subtest #2 100 #101 95 bar: bar.2 102 103 96 bar: bar.1; @: 104 105 97 bar: bar.3 106 98 107 108 99 # Subtest #3 109 #110 100 baz: baz.1 111 112 101 baz: baz.2 113 114 102 baz: ; @: 115 116 ', 103 !, 117 104 '-j1', 118 105 'foo.1 … … 126 113 '); 127 114 115 # TEST #4: eval in a context where there is no reading_file 116 run_make_test(q! 117 .SECONDEXPANSION: 118 all : $$(eval $$(info test)) 119 !, 120 '', "test\n#MAKE#: Nothing to be done for `all'.\n"); 121 122 # TEST #5: (NEGATIVE) catch eval in a prereq list trying to create new 123 # target/prereq relationships. 124 125 run_make_test(q! 126 .SECONDEXPANSION: 127 proj1.exe : proj1.o $$(eval $$(test)) 128 define test 129 proj1.o : proj1.c 130 proj1.c: proj1.h 131 endef 132 !, 133 '', "#MAKE#: *** prerequisites cannot be defined in recipes. Stop.\n", 512); 134 135 136 # Automatic $$+ variable expansion issue. Savannah bug #25780 137 run_make_test(q! 138 all : foo foo 139 .SECONDEXPANSION: 140 all : $$+ ; @echo '$+' 141 foo : ; 142 !, 143 '', "foo foo foo foo\n"); 144 145 146 # Automatic $$+ variable expansion issue. Savannah bug #25780 147 run_make_test(q! 148 all : bar bar 149 bar : ; 150 q%x : ; 151 .SECONDEXPANSION: 152 a%l: q1x $$+ q2x ; @echo '$+' 153 !, 154 '', "q1x bar bar q2x bar bar\n"); 155 156 128 157 # This tells the test driver that the perl test script executed properly. 129 158 1; -
trunk/src/kmk/tests/scripts/features/se_implicit
- Property svn:keywords deleted
r1982 r2591 12 12 # Test #1: automatic variables. 13 13 # 14 run_make_test( '15 .SECONDEXPANSION: 16 .DEFAULT: ; @echo $@14 run_make_test(q! 15 .SECONDEXPANSION: 16 .DEFAULT: ; @echo '$@' 17 17 18 18 foo.a: bar baz … … 38 38 5.buz \ 39 39 6.a: 40 @echo $@41 42 ',40 @echo '$@' 41 42 !, 43 43 '-j1', 44 44 '1.foo.a … … 61 61 # Test #2: target/pattern -specific variables. 62 62 # 63 run_make_test( '63 run_make_test(q! 64 64 .SECONDEXPANSION: 65 65 foo.x: … … 72 72 %.x: x_b := baz 73 73 74 bar baz: ; @echo $@ 75 76 ', 77 '', 78 'bar 79 baz 80 '); 74 bar baz: ; @echo '$@' 75 !, 76 '', "bar\nbaz\n"); 81 77 82 78 83 79 # Test #3: order of prerequisites. 84 80 # 85 run_make_test( '86 .SECONDEXPANSION: 87 .DEFAULT: ; @echo $@81 run_make_test(q! 82 .SECONDEXPANSION: 83 .DEFAULT: ; @echo '$@' 88 84 89 85 all: foo bar baz … … 98 94 foo: foo.3 99 95 100 foo.1: ; @echo $@96 foo.1: ; @echo '$@' 101 97 102 98 … … 109 105 bar: bar.3 110 106 111 bar.1: ; @echo $@107 bar.1: ; @echo '$@' 112 108 113 109 … … 119 115 120 116 %az: ; @: 121 122 ', 123 '-j1', 117 !, 118 '-j1', 124 119 'foo.1 125 120 foo.2 … … 135 130 # Test #4: stem splitting logic. 136 131 # 137 run_make_test( '132 run_make_test(q! 138 133 .SECONDEXPANSION: 139 134 $(dir)/tmp/bar.o: 140 135 141 $(dir)/tmp/foo/bar.c: ; @echo $@142 $(dir)/tmp/bar/bar.c: ; @echo $@143 foo.h: ; @echo $@136 $(dir)/tmp/foo/bar.c: ; @echo '$@' 137 $(dir)/tmp/bar/bar.c: ; @echo '$@' 138 foo.h: ; @echo '$@' 144 139 145 140 %.o: $$(addsuffix /%.c,foo bar) foo.h 146 @echo $@: {$<} $^ 147 148 ', 149 "dir=$dir", 150 "$dir/tmp/foo/bar.c 141 @echo '$@: {$<} $^' 142 !, 143 "dir=$dir", "$dir/tmp/foo/bar.c 151 144 $dir/tmp/bar/bar.c 152 145 foo.h … … 157 150 # Test #5: stem splitting logic and order-only prerequisites. 158 151 # 159 run_make_test( '152 run_make_test(q! 160 153 .SECONDEXPANSION: 161 154 $(dir)/tmp/foo.o: $(dir)/tmp/foo.c 162 $(dir)/tmp/foo.c: ; @echo $@163 bar.h: ; @echo $@155 $(dir)/tmp/foo.c: ; @echo '$@' 156 bar.h: ; @echo '$@' 164 157 165 158 %.o: %.c|bar.h 166 @echo $@: {$<} {$|} $^ 167 168 ', 169 "dir=$dir", 170 "$dir/tmp/foo.c 159 @echo '$@: {$<} {$|} $^' 160 161 !, 162 "dir=$dir", "$dir/tmp/foo.c 171 163 bar.h 172 164 $dir/tmp/foo.o: {$dir/tmp/foo.c} {bar.h} $dir/tmp/foo.c … … 176 168 # Test #6: lack of implicit prerequisites. 177 169 # 178 run_make_test( '170 run_make_test(q! 179 171 .SECONDEXPANSION: 180 172 foo.o: foo.c 181 foo.c: ; @echo $@173 foo.c: ; @echo '$@' 182 174 183 175 %.o: 184 @echo $@: {$<} $^ 185 186 ', 187 '', 188 'foo.c 189 foo.o: {foo.c} foo.c 190 '); 176 @echo '$@: {$<} $^' 177 !, 178 '', "foo.c\nfoo.o: {foo.c} foo.c\n"); 179 191 180 192 181 # Test #7: Test stem from the middle of the name. 193 182 # 194 run_make_test( '183 run_make_test(q! 195 184 .SECONDEXPANSION: 196 185 foobarbaz: 197 186 198 187 foo%baz: % $$*.1 199 @echo $*188 @echo '$*' 200 189 201 190 bar bar.1: 202 @echo $@ 203 204 ', 205 '', 206 'bar 207 bar.1 208 bar 209 '); 191 @echo '$@' 192 !, 193 '', "bar\nbar.1\nbar\n"); 194 210 195 211 196 # Test #8: Make sure stem triple-expansion does not happen. 212 197 # 213 run_make_test( '198 run_make_test(q! 214 199 .SECONDEXPANSION: 215 200 foo$$bar: 216 201 217 202 f%r: % $$*.1 218 @echo \'$*\'203 @echo '$*' 219 204 220 205 oo$$ba oo$$ba.1: 221 @echo \'$@\' 222 223 ', 224 '', 225 'oo$ba 206 @echo '$@' 207 !, 208 '', 'oo$ba 226 209 oo$ba.1 227 210 oo$ba 228 211 '); 229 212 213 # Test #9: Check the value of $^ 214 run_make_test(q! 215 .SECONDEXPANSION: 216 217 %.so: | $$(extra) ; @echo $^ 218 219 foo.so: extra := foo.o 220 foo.so: 221 foo.o: 222 !, 223 '', "\n"); 230 224 231 225 # This tells the test driver that the perl test script executed properly. -
trunk/src/kmk/tests/scripts/features/se_statpat
- Property svn:keywords deleted
r1983 r2591 6 6 # Test #1: automatic variables. 7 7 # 8 run_make_test(' 8 # bird: Had to add -j1 here earlier... 9 run_make_test(q! 9 10 .SECONDEXPANSION: 10 .DEFAULT: ; @echo $@11 .DEFAULT: ; @echo '$@' 11 12 12 13 foo.a foo.b: foo.%: bar.% baz.% 13 14 14 foo.a foo.b: foo.%: biz.% | buz.% 15 15 … … 20 20 $$|.5 \ 21 21 $$*.6 22 23 ', 24 '-j1', 25 'bar.a 22 !, 23 '', 'bar.a 26 24 baz.a 27 25 biz.a … … 42 40 # Test #2: target/pattern -specific variables. 43 41 # 44 run_make_test( '42 run_make_test(q! 45 43 .SECONDEXPANSION: 46 .DEFAULT: ; @echo $@44 .DEFAULT: ; @echo '$@' 47 45 48 46 foo.x foo.y: foo.%: $$(%_a) $$($$*_b) … … 51 49 52 50 %.x: x_b := baz 53 54 55 ', 56 '', 57 'bar 58 baz 59 '); 51 !, 52 '', "bar\nbaz\n"); 60 53 61 54 62 55 # Test #3: order of prerequisites. 63 56 # 64 run_make_test(' 57 # bird: Had to add -j1 here earlier... 58 run_make_test(q! 65 59 .SECONDEXPANSION: 66 .DEFAULT: ; @echo $@60 .DEFAULT: ; @echo '$@' 67 61 68 62 all: foo.a bar.a baz.a 69 63 70 64 # Subtest #1 71 #72 65 foo.a foo.b: foo.%: foo.%.1; @: 73 74 66 foo.a foo.b: foo.%: foo.%.2 75 76 67 foo.a foo.b: foo.%: foo.%.3 77 68 78 69 79 70 # Subtest #2 80 #81 71 bar.a bar.b: bar.%: bar.%.2 82 83 72 bar.a bar.b: bar.%: bar.%.1; @: 84 85 73 bar.a bar.b: bar.%: bar.%.3 86 74 87 75 88 76 # Subtest #3 89 #90 77 baz.a baz.b: baz.%: baz.%.1 91 92 78 baz.a baz.b: baz.%: baz.%.2 93 94 79 baz.a baz.b: ; @: 95 96 ', 97 '-j1', 98 'foo.a.1 80 !, 81 '', 'foo.a.1 99 82 foo.a.2 100 83 foo.a.3 … … 109 92 # Test #4: Make sure stem triple-expansion does not happen. 110 93 # 111 run_make_test( '94 run_make_test(q! 112 95 .SECONDEXPANSION: 113 96 foo$$bar: f%r: % $$*.1 114 @echo \'$*\'97 @echo '$*' 115 98 116 99 oo$$ba oo$$ba.1: 117 @echo \'$@\' 118 119 ', 120 '', 121 'oo$ba 100 @echo '$@' 101 !, 102 '', 'oo$ba 122 103 oo$ba.1 123 104 oo$ba -
trunk/src/kmk/tests/scripts/features/targetvars
r2165 r2591 7 7 rules, semicolon interference, etc."; 8 8 9 open(MAKEFILE,"> $makefile"); 10 11 print MAKEFILE <<'EOF'; 9 run_make_test(' 12 10 SHELL = /bin/sh 13 11 export FOO = foo … … 18 16 three: ; BAR=1000 19 17 @echo $(FOO) $(BAR) 20 # Some things that shouldn 't be target vars18 # Some things that shouldn not be target vars 21 19 funk : override 22 20 funk : override adelic … … 25 23 four:FOO=x 26 24 four:VAR$(FOO)=ok 27 four: ; @echo '$(FOO) $(VAR$(FOO)) $(VAR) $(VARx)'25 four: ; @echo "$(FOO) $(VAR$(FOO)) $(VAR) $(VARx)" 28 26 five:FOO=x 29 27 five six : VAR$(FOO)=good 30 five six: ;@echo '$(FOO) $(VAR$(FOO)) $(VAR) $(VARx) $(VARfoo)'28 five six: ;@echo "$(FOO) $(VAR$(FOO)) $(VAR) $(VARx) $(VARfoo)" 31 29 # Test per-target variable inheritance 32 30 seven: eight … … 42 40 # Test = escaping 43 41 EQ = = 44 ten: one \=two45 ten: one \=two42 ten: one$(EQ)two 43 ten: one $(EQ) two 46 44 ten one$(EQ)two $(EQ):;@echo $@ 47 45 .PHONY: one two three four five six seven eight nine ten $(EQ) one$(EQ)two … … 55 53 foo.r : RVAR += rvar 56 54 foo.t : TVAR := $(QVAR) 57 EOF 58 59 close(MAKEFILE); 60 61 # TEST #1 62 63 &run_make_with_options($makefile, "-j1 one two three", &get_logfile); 64 $answer = "one bar\nfoo two\nBAR=1000\nfoo bar\n"; 65 &compare_output($answer,&get_logfile(1)); 55 ', 56 "one two three", "one bar\nfoo two\nBAR=1000\nfoo bar\n"); 66 57 67 58 # TEST #2 68 59 69 &run_make_with_options($makefile, "-j1 one two FOO=1 BAR=2", &get_logfile); 70 $answer = "one 2\n1 2\n"; 71 &compare_output($answer,&get_logfile(1)); 60 run_make_test(undef, "one two FOO=1 BAR=2", "one 2\n1 2\n"); 72 61 73 62 # TEST #3 74 63 75 &run_make_with_options($makefile, "-j1 four", &get_logfile); 76 $answer = "x ok ok\n"; 77 &compare_output($answer,&get_logfile(1)); 64 run_make_test(undef, "four", "x ok ok\n"); 78 65 79 66 # TEST #4 80 67 81 &run_make_with_options($makefile, "-j1 seven", &get_logfile); 82 $answer = "eight: seven eight\nseven: seven seven\n"; 83 &compare_output($answer,&get_logfile(1)); 68 run_make_test(undef, "seven", "eight: seven eight\nseven: seven seven\n"); 84 69 85 70 # TEST #5 86 71 87 &run_make_with_options($makefile, "-j1 nine", &get_logfile); 88 $answer = "wallace bar wallace bar\n"; 89 &compare_output($answer,&get_logfile(1)); 72 run_make_test(undef, "nine", "wallace bar wallace bar\n"); 90 73 91 74 # TEST #5-a 92 75 93 &run_make_with_options($makefile, "-j1 nine-a", &get_logfile); 94 $answer = "baz\n"; 95 &compare_output($answer,&get_logfile(1)); 76 run_make_test(undef, "nine-a", "baz\n"); 96 77 97 78 # TEST #6 98 79 99 &run_make_with_options($makefile, "-j1 ten", &get_logfile); 100 $answer = "one=two\none bar\n=\nfoo two\nten\n"; 101 &compare_output($answer,&get_logfile(1)); 80 run_make_test(undef, "ten", "one=two\none bar\n=\nfoo two\nten\n"); 102 81 103 82 # TEST #6 104 83 105 &run_make_with_options($makefile, "-j1 foo.q bar.q", &get_logfile); 106 $answer = "qvar = rvar\nqvar =\n"; 107 &compare_output($answer,&get_logfile(1)); 84 run_make_test(undef, "foo.q bar.q", "qvar = rvar\nqvar =\n"); 108 85 109 86 # TEST #7 110 87 111 &run_make_with_options($makefile, "-j1 foo.t bar.s", &get_logfile); 112 $answer = "qvar = qvar\nqvar =\n"; 113 &compare_output($answer,&get_logfile(1)); 88 run_make_test(undef, "foo.t bar.s", "qvar = qvar\nqvar =\n"); 114 89 115 90 … … 117 92 # For PR/1378: Target-specific vars don't inherit correctly 118 93 119 $makefile2 = &get_tmpfile; 120 121 open(MAKEFILE,"> $makefile2"); 122 print MAKEFILE <<'EOF'; 94 run_make_test(' 123 95 foo: FOO = foo 124 96 bar: BAR = bar … … 126 98 bar: baz 127 99 baz: ; @echo $(FOO) $(BAR) 128 EOF 129 close(MAKEFILE); 130 131 &run_make_with_options("$makefile2", "", &get_logfile); 132 $answer = "foo bar\n"; 133 &compare_output($answer, &get_logfile(1)); 100 ', "", "foo bar\n"); 134 101 135 102 # TEST #9 … … 137 104 # Also PR/1831 138 105 139 $makefile3 = &get_tmpfile; 140 141 open(MAKEFILE,"> $makefile3"); 142 print MAKEFILE <<'EOF'; 106 run_make_test(' 143 107 .PHONY: all one 144 108 all: FOO += baz … … 150 114 one: FOO += boz 151 115 one: ; @echo $(FOO) 152 EOF 153 close(MAKEFILE); 154 155 &run_make_with_options("$makefile3", "", &get_logfile); 156 $answer = "bar baz biz boz\nbar baz\n"; 157 &compare_output($answer, &get_logfile(1)); 116 ', 117 '', "bar baz biz boz\nbar baz\n"); 158 118 159 119 # Test #10 160 120 161 &run_make_with_options("$makefile3", "one", &get_logfile); 162 $answer = "bar biz boz\n"; 163 &compare_output($answer, &get_logfile(1)); 121 run_make_test(undef, 'one', "bar biz boz\n"); 164 122 165 123 # Test #11 166 124 # PR/1709: Test semicolons in target-specific variable values 167 125 168 $makefile4 = &get_tmpfile; 169 170 open(MAKEFILE, "> $makefile4"); 171 print MAKEFILE <<'EOF'; 126 run_make_test(' 172 127 foo : FOO = ; ok 173 foo : ; @echo '$(FOO)' 174 EOF 175 close(MAKEFILE); 176 177 &run_make_with_options("$makefile4", "", &get_logfile); 178 $answer = "; ok\n"; 179 &compare_output($answer, &get_logfile(1)); 128 foo : ; @echo "$(FOO)" 129 ', 130 '', "; ok\n"); 180 131 181 132 # Test #12 … … 183 134 # I nailed it this time :-/. 184 135 185 $makefile5 = &get_tmpfile; 186 187 open(MAKEFILE, "> $makefile5"); 188 print MAKEFILE <<'EOF'; 136 run_make_test(' 189 137 .PHONY: a 190 138 … … 196 144 a: BLAH := bar 197 145 a: COMMAND += snafu $(BLAH) 198 EOF 199 close(MAKEFILE); 200 201 &run_make_with_options("$makefile5", "", &get_logfile); 202 $answer = "bar snafu bar\n"; 203 &compare_output($answer, &get_logfile(1)); 146 ', 147 '', "bar snafu bar\n"); 204 148 205 149 # Test #13 206 150 # Test double-colon rules with target-specific variable values 207 151 208 $makefile6 = &get_tmpfile; 209 210 open(MAKEFILE, "> $makefile6"); 211 print MAKEFILE <<'EOF'; 152 run_make_test(' 212 153 W = bad 213 154 X = bad … … 225 166 fo% : Z = pat 226 167 endif 227 228 EOF 229 close(MAKEFILE); 230 231 &run_make_with_options("$makefile6", "foo", &get_logfile); 232 $answer = "ok ok foo nopat\nok ok foo nopat\n"; 233 &compare_output($answer, &get_logfile(1)); 168 ', 169 'foo', "ok ok foo nopat\nok ok foo nopat\n"); 234 170 235 171 # Test #14 … … 237 173 # inheritance 238 174 239 &run_make_with_options("$makefile6", "bar", &get_logfile); 240 $answer = "ok ok bar nopat\nok ok bar nopat\n"; 241 &compare_output($answer, &get_logfile(1)); 175 run_make_test(undef, 'bar', "ok ok bar nopat\nok ok bar nopat\n"); 242 176 243 177 # Test #15 244 178 # Test double-colon rules with pattern-specific variable values 245 179 246 &run_make_with_options("$makefile6", "foo PATTERN=yes", &get_logfile); 247 $answer = "ok ok foo pat\nok ok foo pat\n"; 248 &compare_output($answer, &get_logfile(1)); 249 180 run_make_test(undef, 'foo PATTERN=yes', "ok ok foo pat\nok ok foo pat\n"); 250 181 251 182 # Test #16 … … 253 184 # (> make default buffer length) 254 185 255 $makefile7 = &get_tmpfile; 256 257 open(MAKEFILE, "> $makefile7"); 258 print MAKEFILE <<'EOF'; 186 run_make_test(' 259 187 base_metals_fmd_reports.sun5 base_metals_fmd_reports CreateRealPositions CreateMarginFunds deals_changed_since : BUILD_OBJ=$(shell if [ -f "build_information.generate" ]; then echo "$(OBJ_DIR)/build_information.o"; else echo "no build information"; fi ) 260 188 261 189 deals_changed_since: ; @echo $(BUILD_OBJ) 262 263 EOF 264 close(MAKEFILE); 265 266 &run_make_with_options("$makefile7", '', &get_logfile); 267 $answer = "no build information\n"; 268 &compare_output($answer, &get_logfile(1)); 190 ', 191 '', "no build information\n"); 269 192 270 193 # TEST #17 … … 287 210 .INTERMEDIATE: foo.x rules.mk 288 211 ', 289 '-I t1', 290 'MYVAR= FOOVAR=bar ALLVAR=xxx'); 212 '-I t1', 'MYVAR= FOOVAR=bar ALLVAR=xxx'); 291 213 292 214 rmfiles('t1/rules.mk'); … … 298 220 # double-expansion. See Savannah bug #15913. 299 221 300 run_make_test( "301 VAR := \$\$FOO222 run_make_test(' 223 VAR := $$FOO 302 224 foo: VAR += BAR 303 foo: ; \@echo '\$(VAR)'", 304 '', 305 '$FOO BAR'); 225 foo: ; @echo '."'".'$(VAR)'."'".' 226 ', 227 '', '$FOO BAR'); 228 229 # TEST #19: Override with append variables 230 231 run_make_test(' 232 a: override FOO += f1 233 a: FOO += f2 234 a: ; @echo "$(FOO)" 235 ', 236 '', "f1\n"); 237 238 run_make_test(undef, 'FOO=C', "C f1\n"); 239 240 # TEST #20: Check for continuation after semicolons 241 242 run_make_test(q! 243 a: A = 'hello; \ 244 world' 245 a: ; @echo $(A) 246 !, 247 '', "hello; world\n"); 248 249 # TEST #19: Test define/endef variables as target-specific vars 250 251 # run_make_test(' 252 # define b 253 # @echo global 254 # endef 255 # a: define b 256 # @echo local 257 # endef 258 259 # a: ; $(b) 260 # ', 261 # '', "local\n"); 306 262 307 263 1; -
trunk/src/kmk/tests/scripts/features/vpath
r2162 r2591 1 # -*-perl-*- 2 1 3 $description = "The following test creates a makefile to test the \n" 2 4 ."vpath directive which allows you to specify a search \n" … … 61 63 } 62 64 65 # TEST 2: after vpath lookup ensure we don't get incorrect circular dependency 66 # warnings due to change of struct file ptr. Savannah bug #13529. 67 68 mkdir('vpath-d', 0777); 69 70 run_make_test(q! 71 vpath %.te vpath-d/ 72 .SECONDARY: 73 default: vpath-d/a vpath-d/b 74 vpath-d/a: fail.te 75 vpath-d/b : fail.te 76 vpath-d/fail.te: 77 !, 78 '', "#MAKE#: Nothing to be done for `default'.\n"); 79 80 rmdir('vpath-d'); 81 63 82 1;
Note:
See TracChangeset
for help on using the changeset viewer.