VirtualBox

Ignore:
Timestamp:
Sep 15, 2006 2:30:32 AM (18 years ago)
Author:
bird
Message:

Load make-3.81/ into vendor/gnumake/current.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/gnumake/current/tests/scripts/features/order_only

    r284 r501  
    66prerequisites and ensure they behave properly.  Test the \$| variable.";
    77
    8 open(MAKEFILE,"> $makefile");
     8# TEST #0 -- Basics
    99
    10 print MAKEFILE <<'EOF';
     10run_make_test('
     11%r: | baz ; @echo $< $^ $|
     12bar: foo
     13foo:;@:
     14baz:;@:',
     15              '', "foo foo baz\n");
     16
     17# TEST #1 -- First try: the order-only prereqs need to be built.
     18
     19run_make_test(q!
    1120foo: bar | baz
    1221        @echo '$$^ = $^'
     
    1726
    1827bar baz:
    19         touch $@
    20 EOF
    21 
    22 close(MAKEFILE);
    23 
    24 
    25 # TEST #1 -- just the syntax
    26 
    27 &run_make_with_options($makefile, "", &get_logfile);
    28 $answer = "touch bar\ntouch baz\n\$^ = bar\n\$| = baz\ntouch foo\n";
    29 &compare_output($answer,&get_logfile(1));
     28        touch $@!,
     29              '', "touch bar\ntouch baz\n\$^ = bar\n\$| = baz\ntouch foo\n");
    3030
    3131
    3232# TEST #2 -- now we do it again: baz is PHONY but foo should _NOT_ be updated
    3333
    34 &run_make_with_options($makefile, "", &get_logfile);
    35 $answer = "touch baz\n";
    36 &compare_output($answer,&get_logfile(1));
     34run_make_test(undef, '', "touch baz\n");
    3735
    3836unlink(qw(foo bar baz));
    3937
    40 # Test prereqs that are both order and non-order
     38# TEST #3 -- Make sure the order-only prereq was promoted to normal.
    4139
    42 $makefile2 = &get_tmpfile;
    43 
    44 open(MAKEFILE,"> $makefile2");
    45 
    46 print MAKEFILE <<'EOF';
     40run_make_test(q!
    4741foo: bar | baz
    4842        @echo '$$^ = $^'
     
    5549
    5650bar baz:
    57         touch $@
    58 EOF
    59 
    60 close(MAKEFILE);
    61 
    62 # TEST #3 -- Make sure the order-only prereq was promoted to normal.
    63 
    64 &run_make_with_options($makefile2, "", &get_logfile);
    65 $answer = "touch bar\ntouch baz\n\$^ = bar baz\n\$| = \ntouch foo\n";
    66 &compare_output($answer,&get_logfile(1));
     51        touch $@!,
     52              '', "touch bar\ntouch baz\n\$^ = bar baz\n\$| = \ntouch foo\n");
    6753
    6854
    6955# TEST #4 -- now we do it again
    7056
    71 &run_make_with_options($makefile2, "", &get_logfile);
    72 $answer = "touch baz\n\$^ = bar baz\n\$| = \ntouch foo\n";
    73 &compare_output($answer,&get_logfile(1));
     57run_make_test(undef, '', "touch baz\n\$^ = bar baz\n\$| = \ntouch foo\n");
    7458
    7559unlink(qw(foo bar baz));
     
    7761# Test empty normal prereqs
    7862
    79 $makefile3 = &get_tmpfile;
     63# TEST #5 -- make sure the parser was correct.
    8064
    81 open(MAKEFILE,"> $makefile3");
    82 
    83 print MAKEFILE <<'EOF';
     65run_make_test(q!
    8466foo:| baz
    8567        @echo '$$^ = $^'
     
    9072
    9173baz:
    92         touch $@
    93 EOF
    94 
    95 close(MAKEFILE);
    96 
    97 # TEST #5 -- make sure the parser was correct.
    98 
    99 &run_make_with_options($makefile3, "", &get_logfile);
    100 $answer = "touch baz\n\$^ = \n\$| = baz\ntouch foo\n";
    101 &compare_output($answer,&get_logfile(1));
    102 
     74        touch $@!,
     75              '', "touch baz\n\$^ = \n\$| = baz\ntouch foo\n");
    10376
    10477# TEST #6 -- now we do it again: this time foo won't be built
    10578
    106 &run_make_with_options($makefile3, "", &get_logfile);
    107 $answer = "touch baz\n";
    108 &compare_output($answer,&get_logfile(1));
     79run_make_test(undef, '', "touch baz\n");
    10980
    11081unlink(qw(foo baz));
     
    11283# Test order-only in pattern rules
    11384
    114 $makefile4 = &get_tmpfile;
     85# TEST #7 -- make sure the parser was correct.
    11586
    116 open(MAKEFILE,"> $makefile4");
    117 
    118 print MAKEFILE <<'EOF';
     87run_make_test(q!
    11988%.w : %.x | baz
    12089        @echo '$$^ = $^'
     
    12695.PHONY: baz
    12796foo.x baz:
    128         touch $@
    129 EOF
    130 
    131 close(MAKEFILE);
    132 
    133 # TEST #7 -- make sure the parser was correct.
    134 
    135 &run_make_with_options($makefile4, "", &get_logfile);
    136 $answer = "touch foo.x\ntouch baz\n\$^ = foo.x\n\$| = baz\ntouch foo.w\n";
    137 &compare_output($answer,&get_logfile(1));
     97        touch $@!,
     98              '',
     99              "touch foo.x\ntouch baz\n\$^ = foo.x\n\$| = baz\ntouch foo.w\n");
    138100
    139101# TEST #8 -- now we do it again: this time foo.w won't be built
    140102
    141 &run_make_with_options($makefile4, "", &get_logfile);
    142 $answer = "touch baz\n";
    143 &compare_output($answer,&get_logfile(1));
     103run_make_test(undef, '', "touch baz\n");
    144104
    145105unlink(qw(foo.w foo.x baz));
     
    152112bar: foo
    153113foo:;@:
    154 baz:;@:
    155 ', '', "foo foo baz\n");
     114baz:;@:',
     115              '', "foo foo baz\n");
    156116
    157117
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