VirtualBox

Ignore:
Timestamp:
May 16, 2005 4:54:08 PM (19 years ago)
Author:
bird
Message:

Current make snaphot, 2005-05-16.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/gmake/tests/scripts/features/parallelism

    r53 r284  
    2727}
    2828
    29 open(MAKEFILE,"> $makefile");
    3029
    31 print MAKEFILE <<"EOF";
     30run_make_test("
    3231all : def_1 def_2 def_3
    3332def_1 : ; \@echo ONE; $sleep_command 3 ; echo TWO
    3433def_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 
     34def_3 : ; \@$sleep_command 1 ; echo FOUR",
     35              '-j4', "ONE\nFOUR\nTHREE\nTWO");
    4436
    4537# Test parallelism with included files.  Here we sleep/echo while
    4638# building the included files, to test that they are being built in
    4739# parallel.
    48 
    49 $makefile2 = &get_tmpfile;
    50 
    51 open(MAKEFILE,"> $makefile2");
    52 
    53 print MAKEFILE <<"EOF";
     40run_make_test("
    5441all: 1 2; \@echo success
    55 
    5642-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));
     431.inc: ; \@echo ONE.inc; $sleep_command 2; echo TWO.inc; echo '1: ; \@echo ONE; $sleep_command 2; echo TWO' > \$\@
     442.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");
    6747
    6848unlink('1.inc', '2.inc');
     
    7151# Test parallelism with included files--this time recurse first and make
    7252# 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 
     53run_make_test("
     54recurse: ; \@\$(MAKE) --no-print-directory -f #MAKEFILE# INC=yes all
    8155all: 1 2; \@echo success
    8256
     
    8660endif
    8761
    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));
     621.inc: ; \@echo ONE.inc; $sleep_command 2; echo TWO.inc; echo '1: ; \@echo ONE; $sleep_command 2; echo TWO' > \$\@
     632.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");
    9766
    9867unlink('1.inc', '2.inc');
    9968
     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
     75run_make_test("
     76export HI = \$(shell \$(\$\@.CMD))
     77first.CMD = echo hi
     78second.CMD = $sleep_command 4; echo hi
     79
     80.PHONY: all first second
     81all: first second
     82
     83first second: ; \@echo \$\@; $sleep_command 1; echo \$\@",
     84              '-j2', "first\nfirst\nsecond\nsecond");
     85
    100861;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette