Changeset 284 in kBuild for branches/GNU/src/gmake/tests/scripts/features
- Timestamp:
- May 16, 2005 4:54:08 PM (19 years ago)
- Location:
- branches/GNU/src/gmake/tests/scripts/features
- Files:
-
- 6 edited
-
include (modified) (4 diffs)
-
order_only (modified) (1 diff)
-
parallelism (modified) (3 diffs)
-
patspecific_vars (modified) (1 diff)
-
recursion (modified) (1 diff)
-
statipattrules (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gmake/tests/scripts/features/include
r53 r284 3 3 $description = "Test various forms of the GNU make `include' command."; 4 4 5 $details = "Test include, -include, sinclude and various regressions involving them. 5 $details = "\ 6 Test include, -include, sinclude and various regressions involving them. 6 7 Test extra whitespace at the end of the include, multiple -includes and 7 8 sincludes (should not give an error) and make sure that errors are reported … … 16 17 print MAKEFILE <<EOF; 17 18 \#Extra space at the end of the following file name 18 include $makefile2 19 include $makefile2 19 20 all: ; \@echo There should be no errors for this makefile. 20 21 … … 47 48 &compare_output($answer, &get_logfile(1)); 48 49 50 $makefile = undef; 51 49 52 # Try to build the "error" target; this will fail since we don't know 50 53 # how to create makeit.mk, but we should also get a message (even though … … 52 55 # see one during the makefile run phase). 53 56 54 # The fix to this caused more problems than the error, so I removed it. 55 # pds -- 22 Jan 2000 57 run_make_test 58 (' 59 -include foo.mk 60 error: foo.mk ; @echo $@ 61 ', 62 '', 63 "#MAKE#: *** No rule to make target `foo.mk', needed by `error'. Stop.\n", 64 512 65 ); 56 66 57 #&run_make_with_options($makefile, "error", &get_logfile, 512); 58 #$answer = "$make_name: *** No rule to make target `makeit.mk', needed by `error'.\n"; 59 #&compare_output($answer, &get_logfile(1)); 67 # Make sure that target-specific variables don't impact things. This could 68 # happen because a file record is created when a target-specific variable is 69 # set. 70 71 run_make_test 72 (' 73 bar.mk: foo := baz 74 -include bar.mk 75 hello: ; @echo hello 76 ', 77 '', 78 "hello\n" 79 ); 80 81 # Test inheritance of dontcare flag when rebuilding makefiles. 82 # 83 run_make_test(' 84 .PHONY: all 85 all: ; @: 86 87 -include foo 88 89 foo: bar; @: 90 ', '', ''); 60 91 61 92 1; -
branches/GNU/src/gmake/tests/scripts/features/order_only
r153 r284 145 145 unlink(qw(foo.w foo.x baz)); 146 146 147 # TEST #9 -- make sure that $< is set correctly in the face of order-only 148 # prerequisites in pattern rules. 149 150 run_make_test(' 151 %r: | baz ; @echo $< $^ $| 152 bar: foo 153 foo:;@: 154 baz:;@: 155 ', '', "foo foo baz\n"); 156 157 147 158 1; -
branches/GNU/src/gmake/tests/scripts/features/parallelism
r53 r284 27 27 } 28 28 29 open(MAKEFILE,"> $makefile");30 29 31 print MAKEFILE <<"EOF"; 30 run_make_test(" 32 31 all : def_1 def_2 def_3 33 32 def_1 : ; \@echo ONE; $sleep_command 3 ; echo TWO 34 33 def_2 : ; \@$sleep_command 2 ; echo THREE 35 def_3 : ; \@$sleep_command 1 ; echo FOUR 36 EOF 37 38 close(MAKEFILE); 39 40 &run_make_with_options($makefile, "-j 4", &get_logfile); 41 $answer = "ONE\nFOUR\nTHREE\nTWO\n"; 42 &compare_output($answer, &get_logfile(1)); 43 34 def_3 : ; \@$sleep_command 1 ; echo FOUR", 35 '-j4', "ONE\nFOUR\nTHREE\nTWO"); 44 36 45 37 # Test parallelism with included files. Here we sleep/echo while 46 38 # building the included files, to test that they are being built in 47 39 # parallel. 48 49 $makefile2 = &get_tmpfile; 50 51 open(MAKEFILE,"> $makefile2"); 52 53 print MAKEFILE <<"EOF"; 40 run_make_test(" 54 41 all: 1 2; \@echo success 55 56 42 -include 1.inc 2.inc 57 58 1.inc: ; \@echo ONE.inc; $sleep_command 2; echo TWO.inc; echo "1: ; \@echo ONE; $sleep_command 2; echo TWO" > \$\@ 59 2.inc: ; \@$sleep_command 1; echo THREE.inc; echo "2: ; \@$sleep_command 1; echo THREE" > \$\@ 60 EOF 61 62 close(MAKEFILE); 63 64 &run_make_with_options("$makefile2", "-j 4", &get_logfile); 65 $answer = "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n"; 66 &compare_output($answer, &get_logfile(1)); 43 1.inc: ; \@echo ONE.inc; $sleep_command 2; echo TWO.inc; echo '1: ; \@echo ONE; $sleep_command 2; echo TWO' > \$\@ 44 2.inc: ; \@$sleep_command 1; echo THREE.inc; echo '2: ; \@$sleep_command 1; echo THREE' > \$\@", 45 "-j4", 46 "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n"); 67 47 68 48 unlink('1.inc', '2.inc'); … … 71 51 # Test parallelism with included files--this time recurse first and make 72 52 # sure the jobserver works. 73 74 $makefile3 = &get_tmpfile; 75 76 open(MAKEFILE,"> $makefile3"); 77 78 print MAKEFILE <<"EOF"; 79 recurse: ; \@\$(MAKE) --no-print-directory -f $makefile3 INC=yes all 80 53 run_make_test(" 54 recurse: ; \@\$(MAKE) --no-print-directory -f #MAKEFILE# INC=yes all 81 55 all: 1 2; \@echo success 82 56 … … 86 60 endif 87 61 88 1.inc: ; \@echo ONE.inc; $sleep_command 2; echo TWO.inc; echo "1: ; \@echo ONE; $sleep_command 2; echo TWO" > \$\@ 89 2.inc: ; \@$sleep_command 1; echo THREE.inc; echo "2: ; \@$sleep_command 1; echo THREE" > \$\@ 90 EOF 91 92 close(MAKEFILE); 93 94 &run_make_with_options("$makefile3", "-j 4", &get_logfile); 95 $answer = "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n"; 96 &compare_output($answer, &get_logfile(1)); 62 1.inc: ; \@echo ONE.inc; $sleep_command 2; echo TWO.inc; echo '1: ; \@echo ONE; $sleep_command 2; echo TWO' > \$\@ 63 2.inc: ; \@$sleep_command 1; echo THREE.inc; echo '2: ; \@$sleep_command 1; echo THREE' > \$\@", 64 "-j4", 65 "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n"); 97 66 98 67 unlink('1.inc', '2.inc'); 99 68 69 # Grant Taylor reports a problem where tokens can be lost (not written back 70 # to the pipe when they should be): this happened when there is a $(shell ...) 71 # function in an exported recursive variable. I added some code to check 72 # for this situation and print a message if it occurred. This test used 73 # to trigger this code when I added it but no longer does after the fix. 74 75 run_make_test(" 76 export HI = \$(shell \$(\$\@.CMD)) 77 first.CMD = echo hi 78 second.CMD = $sleep_command 4; echo hi 79 80 .PHONY: all first second 81 all: first second 82 83 first second: ; \@echo \$\@; $sleep_command 1; echo \$\@", 84 '-j2', "first\nfirst\nsecond\nsecond"); 85 100 86 1; -
branches/GNU/src/gmake/tests/scripts/features/patspecific_vars
r53 r284 62 62 &compare_output($answer,&get_logfile(1)); 63 63 64 # TEST #5 -- test pattern-specific exported variables 65 # 66 run_make_test(' 67 /%: export foo := foo 68 69 /bar: 70 @test "$(foo)" = "$$foo" 71 ', '', ''); 72 73 74 # TEST #6 -- test expansion of pattern-specific simple variables 75 # 76 run_make_test(' 77 .PHONY: all 78 79 all: inherit := good $$t 80 all: bar baz 81 82 b%: pattern := good $$t 83 84 global := orginal $$t 85 86 87 # normal target 88 # 89 ifdef rec 90 bar: a = global: $(global) pattern: $(pattern) inherit: $(inherit) 91 else 92 bar: a := global: $(global) pattern: $(pattern) inherit: $(inherit) 93 endif 94 95 bar: ; @echo \'normal: $a;\' 96 97 98 # pattern target 99 # 100 ifdef rec 101 %z: a = global: $(global) pattern: $(pattern) inherit: $(inherit) 102 else 103 %z: a := global: $(global) pattern: $(pattern) inherit: $(inherit) 104 endif 105 106 %z: ; @echo \'pattrn: $a;\' 107 108 109 global := new $$t 110 ', 111 '', 112 'normal: global: orginal $t pattern: inherit: ; 113 pattrn: global: orginal $t pattern: inherit: ;'); 114 115 116 # TEST #7 -- test expansion of pattern-specific recursive variables 117 # 118 run_make_test(undef, # reuse previous makefile 119 'rec=1', 120 'normal: global: new $t pattern: good $t inherit: good $t; 121 pattrn: global: new $t pattern: good $t inherit: good $t;'); 122 123 64 124 1; -
branches/GNU/src/gmake/tests/scripts/features/recursion
r53 r284 1 1 # -*-perl-*- 2 $description = "T he following test creates a makefile to ...\n";2 $description = "Test recursion."; 3 3 4 4 $details = "DETAILS"; 5 5 6 open(MAKEFILE,"> $makefile"); 6 # Test some basic recursion. 7 run_make_test(' 8 all: 9 $(MAKE) -f #MAKEFILE# foo 10 foo: 11 @echo $(MAKE) 12 @echo MAKELEVEL = $(MAKELEVEL) 13 $(MAKE) -f #MAKEFILE# last 14 last: 15 @echo $(MAKE) 16 @echo MAKELEVEL = $(MAKELEVEL) 17 @echo THE END 18 ', 19 ('CFLAGS=-O -w' . ($parallel_jobs ? '-j 2' : '')), 20 ($vos 21 ? "#MAKE#: Entering directory `#PWD#' 22 make 'CFLAGS=-O' -f #MAKEFILE# foo 23 make CFLAGS=-O 24 MAKELEVEL = 0 25 make 'CFLAGS=-O' -f #MAKEFILE# last 26 make CFLAGS=-O 27 MAKELEVEL = 0 28 THE END 29 #MAKE#: Leaving directory `#PWD#'" 30 : "#MAKE#: Entering directory `#PWD#' 31 #MAKEPATH# -f #MAKEFILE# foo 32 #MAKE#[1]: Entering directory `#PWD#' 33 #MAKEPATH# 34 MAKELEVEL = 1 35 #MAKEPATH# -f #MAKEFILE# last 36 #MAKE#[2]: Entering directory `#PWD#' 37 #MAKEPATH# 38 MAKELEVEL = 2 39 THE END 40 #MAKE#[2]: Leaving directory `#PWD#' 41 #MAKE#[1]: Leaving directory `#PWD#' 42 #MAKE#: Leaving directory `#PWD#'")); 7 43 8 # The Contents of the MAKEFILE ...9 44 10 print MAKEFILE "all: \n" 11 ."\t\$(MAKE) -f $makefile foo \n" 12 ."foo: \n" 13 ."\t\@echo \$(MAKE) \n" 14 ."\t\@echo MAKELEVEL = \$(MAKELEVEL)\n" 15 ."\t\$(MAKE) -f $makefile last \n" 16 ."last: \n" 17 ."\t\@echo \$(MAKE) \n" 18 ."\t\@echo MAKELEVEL = \$(MAKELEVEL) \n" 19 ."\t\@echo THE END\n"; 20 21 # END of Contents of MAKEFILE 22 23 close(MAKEFILE); 24 25 if ($vos) 26 { 27 $answer = "$make_name: Entering directory \`$pwd\'\n" 28 ."make 'CFLAGS=-O' -f $makefile foo \n" 29 ."make CFLAGS=-O\n" 30 ."MAKELEVEL = 0\n" 31 ."make 'CFLAGS=-O' -f $makefile last \n" 32 ."make CFLAGS=-O\n" 33 ."MAKELEVEL = 0\n" 34 ."THE END\n" 35 ."$make_name: Leaving directory `$pwd'\n"; 36 } 37 else 38 { 39 $answer = "$make_name: Entering directory `$pwd'\n" 40 ."$mkpath -f $makefile foo \n" 41 ."${make_name}[1]: Entering directory `$pwd'\n" 42 ."$mkpath\n" 43 ."MAKELEVEL = 1\n" 44 ."$mkpath -f $makefile last \n" 45 ."${make_name}[2]: Entering directory `$pwd'\n" 46 ."$mkpath\n" 47 ."MAKELEVEL = 2\n" 48 ."THE END\n" 49 ."${make_name}[2]: Leaving directory `$pwd'\n" 50 ."${make_name}[1]: Leaving directory `$pwd'\n" 51 ."$make_name: Leaving directory `$pwd'\n"; 52 } 53 54 $mkoptions = "CFLAGS=-O -w"; 55 $mkoptions .= " -j 2" if ($parallel_jobs); 56 57 &run_make_with_options($makefile,$mkoptions,&get_logfile,0); 58 59 &compare_output($answer,&get_logfile(1)); 45 # Test command line overrides. 46 run_make_test(' 47 recur: all ; @$(MAKE) --no-print-directory -f #MAKEFILE# a=AA all 48 all: ; @echo "MAKEOVERRIDES = $(MAKEOVERRIDES)" 49 ', 50 'a=ZZ', 51 'MAKEOVERRIDES = a=ZZ 52 MAKEOVERRIDES = a=AA 53 '); 60 54 61 55 1; -
branches/GNU/src/gmake/tests/scripts/features/statipattrules
r53 r284 56 56 $makefile2 = &get_tmpfile; 57 57 open(MAKEFILE, "> $makefile2"); 58 print MAKEFILE "foo: foo%: % ; \@echo $@\n";58 print MAKEFILE "foo: foo%: % ; \@echo \$@\n"; 59 59 close(MAKEFILE); 60 60 61 &run_make_with_options($makefile2, '', &get_logfile , 512);62 $answer = " $makefile2:1: *** target `foo' leaves prerequisite pattern empty. Stop.\n";61 &run_make_with_options($makefile2, '', &get_logfile); 62 $answer = "foo\n"; 63 63 &compare_output($answer, &get_logfile(1)); 64 64 65 # TEST #5 -- bug #12180: core dump on a stat pattern rule with an empty 66 # prerequisite list. 67 # 68 run_make_test(' 69 foo.x bar.x: %.x : ; @echo $@ 70 71 ', 72 '', 73 'foo.x 74 '); 65 75 66 76 1; 67 68 69 70 71 72
Note:
See TracChangeset
for help on using the changeset viewer.

