Changeset 284 in kBuild for branches/GNU/src/gmake/tests/scripts/features/parallelism
- Timestamp:
- May 16, 2005 4:54:08 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note:
See TracChangeset
for help on using the changeset viewer.

