VirtualBox

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

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

Location:
vendor/gnumake/current/tests/scripts/features
Files:
16 edited

Legend:

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

    r53 r501  
    88
    99open(MAKEFILE,"> $makefile");
    10 
    1110print MAKEFILE "FIRST: ; \@echo It chose GNUmakefile\n";
    12 
    1311close(MAKEFILE);
    1412
    1513# DOS/WIN32 platforms preserve case, but Makefile is the same file as makefile.
    1614# Just test what we can here (avoid Makefile versus makefile test).
    17 #
    18 if ($port_type eq 'UNIX')
    19 {
     15
     16if ($port_type eq 'UNIX') {
    2017  # Create another makefile called "makefile"
    2118  open(MAKEFILE,"> makefile");
    22 
    2319  print MAKEFILE "SECOND: ; \@echo It chose makefile\n";
    24 
    2520  close(MAKEFILE);
    2621}
    2722
    28 
    2923# Create another makefile called "Makefile"
    3024open(MAKEFILE,"> Makefile");
    31 
    3225print MAKEFILE "THIRD: ; \@echo It chose Makefile\n";
    33 
    3426close(MAKEFILE);
    3527
    3628
    3729&run_make_with_options("","",&get_logfile);
    38 
    39 # Create the answer to what should be produced by this Makefile
    40 $answer = "It chose GNUmakefile\n";
    41 
    42 # COMPARE RESULTS
    43 
    44 &compare_output($answer,&get_logfile(1)) || &error("abort");
     30&compare_output("It chose GNUmakefile\n",&get_logfile(1));
    4531unlink $makefile;
    4632
    47 # DOS/WIN32 platforms preserve case, but Makefile is the same file as makefile.
    48 # Just test what we can here (avoid Makefile versus makefile test).
    49 #
    50 if ($port_type eq 'UNIX')
    51 {
    52   $answer = "It chose makefile\n";
    53 
     33if ($port_type eq 'UNIX') {
    5434  &run_make_with_options("","",&get_logfile);
    55 
    56   &compare_output($answer,&get_logfile(1)) || &error("abort");
     35  &compare_output("It chose makefile\n",&get_logfile(1));
    5736  unlink "makefile";
    5837}
    5938
    60 $answer = "It chose Makefile\n";
    61 
    6239&run_make_with_options("","",&get_logfile);
    63 
    64 &compare_output($answer,&get_logfile(1)) || &error("abort");
     40&compare_output("It chose Makefile\n",&get_logfile(1));
    6541unlink "Makefile";
  • vendor/gnumake/current/tests/scripts/features/double_colon

    r53 r501  
    125125unlink('foo','f1.h','f2.h');
    126126
     127
     128# TEST 9: make sure all rules in s double colon family get executed
     129#         (Savannah bug #14334).
     130#
     131
     132&touch('one');
     133&touch('two');
     134
     135run_make_test('
     136.PHONY: all
     137all: result
     138
     139result:: one
     140        @echo $^ >>$@
     141        @echo $^
     142
     143result:: two
     144        @echo $^ >>$@
     145        @echo $^
     146
     147',
     148'',
     149'one
     150two');
     151
     152unlink('result','one','two');
     153
     154# This tells the test driver that the perl test script executed properly.
    1271551;
  • vendor/gnumake/current/tests/scripts/features/errors

    r280 r501  
     1#                                                                    -*-perl-*-
     2
    13$description = "The following tests the -i option and the '-' in front of \n"
    24              ."commands to test that make ignores errors in these commands\n"
     
    1517if ($vos)
    1618{
    17    $delete_command = "delete_file";
     19   $rm_command = "delete_file";
    1820}
    1921else
    2022{
    21    $delete_command = "rm";
     23   $rm_command = "rm";
    2224}
    2325
     
    2729
    2830print MAKEFILE "clean:\n"
    29               ."\t-$delete_command cleanit\n"
    30               ."\t$delete_command foo\n"
     31              ."\t-$rm_command cleanit\n"
     32              ."\t$rm_command foo\n"
    3133              ."clean2: \n"
    32               ."\t$delete_command cleanit\n"
    33               ."\t$delete_command foo\n";
     34              ."\t$rm_command cleanit\n"
     35              ."\t$rm_command foo\n";
    3436
    3537# END of Contents of MAKEFILE
     
    4042
    4143unlink("cleanit");
    42 $cleanit_error = `sh -c "$delete_command cleanit 2>&1"`;
     44$cleanit_error = `sh -c "$rm_command cleanit 2>&1"`;
    4345$delete_error_code = $? >> 8;
    4446
     
    4648# -------
    4749
    48 $answer = "$delete_command cleanit\n"
     50$answer = "$rm_command cleanit\n"
    4951         . $cleanit_error
    5052         ."$make_name: [clean] Error $delete_error_code (ignored)\n"
    51          ."$delete_command foo\n";
     53         ."$rm_command foo\n";
    5254
    5355&run_make_with_options($makefile,"",&get_logfile);
     
    7375# -------
    7476
    75 $answer = "$delete_command cleanit\n"
     77$answer = "$rm_command cleanit\n"
    7678         . $cleanit_error
    7779         ."$make_name: [clean2] Error $delete_error_code (ignored)\n"
    78          ."$delete_command foo\n";
     80         ."$rm_command foo\n";
    7981
    8082&run_make_with_options($makefile,"clean2 -i",&get_logfile);
  • vendor/gnumake/current/tests/scripts/features/escape

    r53 r501  
    77Make sure that escaping of '#' works.";
    88
    9 open(MAKEFILE,"> $makefile");
    10 
    11 print MAKEFILE <<'EOF';
    12 $(path)foo : ; @echo cp $^ $@
    13 
    14 foo\ bar: ; @echo 'touch "$@"'
    15 
    16 sharp: foo\#bar.ext
    17 foo\#bar.ext: ; @echo foo\#bar.ext = '$@'
    18 EOF
    199
    2010close(MAKEFILE);
     
    2313# TEST 1
    2414
    25 &run_make_with_options($makefile, "", &get_logfile);
    26 $answer = "cp foo\n";
    27 &compare_output($answer,&get_logfile(1));
     15run_make_test('
     16$(path)foo : ; @echo "touch ($@)"
     17
     18foo\ bar: ; @echo "touch ($@)"
     19
     20sharp: foo\#bar.ext
     21foo\#bar.ext: ; @echo "foo#bar.ext = ($@)"',
     22              '',
     23              'touch (foo)');
    2824
    2925# TEST 2: This one should fail, since the ":" is unquoted.
    3026
    31 &run_make_with_options($makefile, "path=p:", &get_logfile, 512);
    32 $answer = "$makefile:1: *** target pattern contains no `%'.  Stop.\n";
    33 &compare_output($answer,&get_logfile(1));
     27run_make_test(undef,
     28              'path=pre:',
     29              "#MAKEFILE#:2: *** target pattern contains no `%'.  Stop.",
     30              512);
    3431
    3532# TEST 3: This one should work, since we escape the ":".
    3633
    37 &run_make_with_options($makefile, "'path=p\\:'", &get_logfile, 0);
    38 $answer = "cp p:foo\n";
    39 &compare_output($answer,&get_logfile(1));
     34run_make_test(undef,
     35              "'path=pre\\:'",
     36              'touch (pre:foo)');
    4037
    4138# TEST 4: This one should fail, since the escape char is escaped.
    4239
    43 &run_make_with_options($makefile, "'path=p\\\\:'", &get_logfile, 512);
    44 $answer = "$makefile:1: *** target pattern contains no `%'.  Stop.\n";
    45 &compare_output($answer,&get_logfile(1));
     40run_make_test(undef,
     41              "'path=pre\\\\:'",
     42              "#MAKEFILE#:2: *** target pattern contains no `%'.  Stop.",
     43              512);
    4644
    4745# TEST 5: This one should work
    4846
    49 &run_make_with_options($makefile, "'foo bar'", &get_logfile, 0);
    50 $answer = "touch \"foo bar\"\n";
    51 &compare_output($answer,&get_logfile(1));
     47run_make_test(undef,
     48              "'foo bar'",
     49              'touch (foo bar)');
    5250
    5351# TEST 6: Test escaped comments
    5452
    55 &run_make_with_options($makefile, "sharp", &get_logfile, 0);
    56 $answer = "foo#bar.ext = foo#bar.ext\n";
    57 &compare_output($answer,&get_logfile(1));
     53run_make_test(undef,
     54              'sharp',
     55              'foo#bar.ext = (foo#bar.ext)');
    5856
    5957# This tells the test driver that the perl test script executed properly.
  • vendor/gnumake/current/tests/scripts/features/export

    r53 r501  
    5757# TEST 1: make sure vars inherited from the parent are exported
    5858
    59 $ENV{FOO} = 1;
     59$extraENV{FOO} = 1;
    6060
    6161&run_make_with_options($makefile,"",&get_logfile,0);
     
    6565
    6666&compare_output($answer,&get_logfile(1));
    67 
    68 delete $ENV{FOO};
    6967
    7068# TEST 2: global export.  Explicit unexport takes precedence.
     
    238236close(MAKEFILE);
    239237
    240 @ENV{qw(A B C D E F G H I J)} = qw(1 2 3 4 5 6 7 8 9 10);
     238@extraENV{qw(A B C D E F G H I J)} = qw(1 2 3 4 5 6 7 8 9 10);
    241239
    242240&run_make_with_options($makefile5,"",&get_logfile,0);
     
    244242&compare_output($answer,&get_logfile(1));
    245243
    246 delete @ENV{qw(A B C D E F G H I J)};
    247 
    248244
    249245# This tells the test driver that the perl test script executed properly.
  • vendor/gnumake/current/tests/scripts/features/include

    r284 r501  
    7979  );
    8080
     81
    8182# Test inheritance of dontcare flag when rebuilding makefiles.
    8283#
     
    9192
    92931;
     94
     95
     96# Make sure that we don't die when the command fails but we dontcare.
     97# (Savannah bug #13216).
     98#
     99run_make_test('
     100.PHONY: all
     101all:; @:
     102
     103-include foo
     104
     105foo: bar; @:
     106
     107bar:; @exit 1
     108', '', '');
     109
     110# Check include, sinclude, -include with no filenames.
     111# (Savannah bug #1761).
     112
     113run_make_test('
     114.PHONY: all
     115all:; @:
     116include
     117-include
     118sinclude', '', '');
     119
     1201;
  • 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
  • vendor/gnumake/current/tests/scripts/features/parallelism

    r284 r501  
    1919
    2020if ($vos) {
    21   $delete_command = "delete_file -no_ask";
    2221  $sleep_command = "sleep -seconds";
    2322}
    2423else {
    25   $delete_command = "rm -f";
    2624  $sleep_command = "sleep";
    2725}
     
    8482              '-j2', "first\nfirst\nsecond\nsecond");
    8583
     84# Michael Matz <matz@suse.de> reported a bug where if make is running in
     85# parallel without -k and two jobs die in a row, but not too close to each
     86# other, then make will quit without waiting for the rest of the jobs to die.
     87
     88run_make_test("
     89.PHONY: all fail.1 fail.2 fail.3 ok
     90all: fail.1 ok fail.2 fail.3
     91
     92fail.1 fail.2 fail.3:
     93        \@sleep \$(patsubst fail.%,%,\$\@)
     94        \@echo Fail
     95        \@exit 1
     96
     97ok:
     98        \@sleep 4
     99        \@echo Ok done",
     100              '-rR -j5', 'Fail
     101#MAKE#: *** [fail.1] Error 1
     102#MAKE#: *** Waiting for unfinished jobs....
     103Fail
     104#MAKE#: *** [fail.2] Error 1
     105Fail
     106#MAKE#: *** [fail.3] Error 1
     107Ok done',
     108             512);
     109
     110
     111# Test for Savannah bug #15641.
     112#
     113run_make_test('
     114.PHONY: all
     115all:; @:
     116
     117-include foo.d
     118
     119foo.d: comp
     120        @echo building $@
     121
     122comp: mod_a.o mod_b.o; @:
     123
     124mod_a.o mod_b.o:
     125        @exit 1
     126', '-j2', '');
     127
     128
     129# Make sure that all jobserver FDs are closed if we need to re-exec the
     130# master copy.
     131#
     132# First, find the "default" file descriptors we normally use
     133# Then make sure they're still used.
     134#
     135# Right now we don't have a way to run a makefile and capture the output
     136# without checking it, so we can't really write this test.
     137
     138# run_make_test('
     139# submake: ; @$(MAKE) --no-print-directory -f #MAKEFILE# fdprint 5>output
     140
     141# dependfile: ; @echo FOO=bar > $@
     142
     143# INCL := true
     144
     145# FOO=foo
     146# ifeq ($(INCL),true)
     147# -include dependfile
     148# endif
     149
     150# fdprint: ; @echo $(filter --jobserver%,$(MAKEFLAGS))
     151
     152# recurse: ; @$(MAKE) --no-print-directory -f #MAKEFILE# submake INCL=true',
     153#               '-j2 INCL=false fdprint',
     154#               'bar');
     155
     156# unlink('dependfile', 'output');
     157
     158
     159# # Do it again, this time where the include is done by the non-master make.
     160# run_make_test(undef, '-j2 recurse INCL=false', 'bar');
     161
     162# unlink('dependfile', 'output');
     163
    861641;
  • vendor/gnumake/current/tests/scripts/features/patspecific_vars

    r284 r501  
    6868
    6969/bar:
    70         @test "$(foo)" = "$$foo"
    71 ', '', '');
     70        @echo $(foo) $$foo
     71', '', 'foo foo');
    7272
    7373
  • vendor/gnumake/current/tests/scripts/features/patternrules

    r283 r501  
    2424# 1 - existing file
    2525%.1: void
    26         @false
     26        @exit 1
    2727%.1: #MAKEFILE#
    28         @true
     28        @exit 0
    2929
    3030# 2 - phony
    3131%.2: void
    32         @false
     32        @exit 1
    3333%.2: 2.phony
    34         @true
     34        @exit 0
    3535.PHONY: 2.phony
    3636
    3737# 3 - implicit-phony
    3838%.3: void
    39         @false
     39        @exit 1
    4040%.3: 3.implicit-phony
    41         @true
     41        @exit 0
    4242
    43433.implicit-phony:
     
    9696unlink("$dir/foo.c");
    9797
     98
     99# TEST #4: make sure precious flag is set properly for targets
     100#          that are built via implicit rules (Savannah bug #13218).
     101#
     102run_make_test('
     103.DELETE_ON_ERROR:
     104
     105.PRECIOUS: %.bar
     106
     107%.bar:; @touch $@ && exit 1
     108
     109$(dir)/foo.bar:
     110
     111',
     112"dir=$dir",
     113"#MAKE#: *** [$dir/foo.bar] Error 1",
     114512);
     115
     116unlink("$dir/foo.bar");
     117
     118
     119# TEST #5: make sure targets of a macthed implicit pattern rule never
     120#          never considered intermediate (Savannah bug #13022).
     121#
     122run_make_test('
     123.PHONY: all
     124all: foo.c foo.o
     125
     126%.h %.c: %.in
     127        touch $*.h
     128        touch $*.c
     129
     130%.o: %.c %.h
     131        echo $+ >$@
     132
     133%.o: %.c
     134        @echo wrong rule
     135
     136foo.in:
     137        touch $@
     138
     139',
     140'',
     141'touch foo.in
     142touch foo.h
     143touch foo.c
     144echo foo.c foo.h >foo.o');
     145
     146unlink('foo.in', 'foo.h', 'foo.c', 'foo.o');
     147
    98148# This tells the test driver that the perl test script executed properly.
    991491;
  • vendor/gnumake/current/tests/scripts/features/reinvoke

    r53 r501  
    88file, then touch the temp file to make it newer than the makefile.";
    99
    10 $makefile2 = &get_tmpfile;
    11 $makefile_orig = &get_tmpfile;
     10$omkfile = $makefile;
    1211
    13 open(MAKEFILE,"> $makefile");
     12&utouch(-600, 'incl.mk');
     13# For some reason if we don't do this then the test fails for systems
     14# with sub-second timestamps, maybe + NFS?  Not sure.
     15&utouch(-1, 'incl-1.mk');
    1416
    15 print MAKEFILE <<EOM;
     17run_make_test('
     18all: ; @echo running rules.
    1619
    17 all: ; \@echo 'running rules.'
     20#MAKEFILE# incl.mk: incl-1.mk
     21        @echo rebuilding $@
     22        @echo >> $@
    1823
    19 $makefile $makefile2: $makefile_orig
    20         \@echo 'rebuilding \$\@.'
    21         \@echo >> \$\@
     24include incl.mk',
     25              '', "rebuilding incl.mk\nrunning rules.\n");
    2226
    23 include $makefile2
     27# Make sure updating the makefile itself also works
    2428
    25 EOM
     29&utouch(-600, $omkfile);
    2630
    27 close(MAKEFILE);
     31run_make_test(undef, '', "rebuilding #MAKEFILE#\nrunning rules.\n");
    2832
    29 &utouch(-10, $makefile, $makefile2);
    30 &touch($makefile_orig);
     33&rmfiles('incl.mk', 'incl-1.mk');
    3134
    32 &run_make_with_options($makefile, "", &get_logfile, 0);
    33 
    34 # Create the answer to what should be produced by this Makefile
    35 
    36 $answer = "rebuilding $makefile2.\nrebuilding $makefile.\nrunning rules.\n";
    37 
    38 &compare_output($answer,&get_logfile(1))
    39   && unlink "$makefile_orig";
    4035
    4136# In this test we create an included file that's out-of-date, but then
    4237# the rule doesn't update it.  Make shouldn't re-exec.
    4338
    44 $makefile3 = &get_tmpfile;
     39&utouch(-600, 'b','a');
     40#&utouch(-10, 'a');
     41&touch('c');
    4542
    46 open(MAKEFILE, "> $makefile3");
    47 print MAKEFILE <<'EOM';
     43run_make_test('
    4844SHELL = /bin/sh
    4945
     
    5652c: ; echo >> $@
    5753
    58 include $(F)
    59 EOM
    60 
    61 close(MAKEFILE);
    62 
    63 &utouch(-20, 'b','a');
    64 #&utouch(-10, 'a');
    65 &touch('c');
    66 
    67 # First try with the file that's not updated "once removed" from the
    68 # file we're including.
    69 
    70 &run_make_with_options($makefile3, "F=a", &get_logfile, 0);
    71 
    72 $answer = "[ -f b ] || echo >> b\nhello\n";
    73 &compare_output($answer,&get_logfile(1));
     54include $(F)',
     55              'F=a', "[ -f b ] || echo >> b\nhello\n");
    7456
    7557# Now try with the file we're not updating being the actual file we're
    7658# including: this and the previous one test different parts of the code.
    7759
    78 &run_make_with_options($makefile3, "F=b", &get_logfile, 0);
     60run_make_test(undef, "F=b", "[ -f b ] || echo >> b\nhello\n")
    7961
    80 $answer = "[ -f b ] || echo >> b\nhello\n";
    81 &compare_output($answer,&get_logfile(1));
    82 
    83 unlink('a','b','c');
     62&rmfiles('a','b','c');
    8463
    8564# This tells the test driver that the perl test script executed properly.
  • vendor/gnumake/current/tests/scripts/features/se_explicit

    r283 r501  
    44$details = "";
    55
    6 # Test #1: automatic variables.
     6# TEST #0: Test handing of '$' in prerequisites with and without second
     7# expansion.
     8
     9run_make_test(q!
     10ifdef SE
     11  .SECONDEXPANSION:
     12endif
     13foo$$bar: bar$$baz bar$$biz ; @echo '$@ : $^'
     14PRE = one two
     15bar$$baz: $$(PRE)
     16baraz: $$(PRE)
     17PRE = three four
     18.DEFAULT: ; @echo '$@'
     19!,
     20              '',
     21              "\$\nbar\$biz\nfoo\$bar : bar\$baz bar\$biz");
     22
     23run_make_test(undef, 'SE=1', "three\nfour\nbariz\nfoo\$bar : baraz bariz");
     24
     25# TEST #1: automatic variables.
    726#
    827run_make_test('
     28.SECONDEXPANSION:
    929.DEFAULT: ; @echo $@
    1030
     
    4262#
    4363run_make_test('
     64.SECONDEXPANSION:
    4465.DEFAULT: ; @echo $@
    4566
     
    6081#
    6182run_make_test('
     83.SECONDEXPANSION:
    6284.DEFAULT: ; @echo $@
    6385
  • vendor/gnumake/current/tests/scripts/features/se_implicit

    r283 r501  
    1313#
    1414run_make_test('
     15.SECONDEXPANSION:
    1516.DEFAULT: ; @echo $@
    1617
     
    6162#
    6263run_make_test('
     64.SECONDEXPANSION:
    6365foo.x:
    6466
     
    8284#
    8385run_make_test('
     86.SECONDEXPANSION:
    8487.DEFAULT: ; @echo $@
    8588
     
    133136#
    134137run_make_test('
     138.SECONDEXPANSION:
    135139$(dir)/tmp/bar.o:
    136140
     
    154158#
    155159run_make_test('
     160.SECONDEXPANSION:
    156161$(dir)/tmp/foo.o: $(dir)/tmp/foo.c
    157162$(dir)/tmp/foo.c: ; @echo $@
     
    172177#
    173178run_make_test('
     179.SECONDEXPANSION:
    174180foo.o: foo.c
    175181foo.c: ; @echo $@
     
    187193#
    188194run_make_test('
     195.SECONDEXPANSION:
    189196foobarbaz:
    190197
     
    205212#
    206213run_make_test('
     214.SECONDEXPANSION:
    207215foo$$bar:
    208216
  • vendor/gnumake/current/tests/scripts/features/se_statpat

    r283 r501  
    77#
    88run_make_test('
     9.SECONDEXPANSION:
    910.DEFAULT: ; @echo $@
    1011
     
    4243#
    4344run_make_test('
     45.SECONDEXPANSION:
    4446.DEFAULT: ; @echo $@
    4547
     
    6163#
    6264run_make_test('
     65.SECONDEXPANSION:
    6366.DEFAULT: ; @echo $@
    6467
     
    107110#
    108111run_make_test('
     112.SECONDEXPANSION:
    109113foo$$bar: f%r: % $$*.1
    110114        @echo \'$*\'
  • vendor/gnumake/current/tests/scripts/features/statipattrules

    r284 r501  
    1010to emacs a .el file";
    1111
    12 open(MAKEFILE,"> $makefile");
    13 print MAKEFILE <<'EOF';
     12&touch('bar.c', 'lose.c');
     13
     14#   TEST #0
     15#   -------
     16
     17run_make_test('
    1418files = foo.elc bar.o lose.o
    1519
     
    1721
    1822$(filter %.elc,$(files)): %.elc: %.el ; @echo emacs $<
    19 EOF
    20 close(MAKEFILE);
     23',
     24              '',
     25              'CC -c bar.c -o bar.o');
     26
     27#  TEST #1
     28#  -------
     29
     30run_make_test(undef, 'lose.o', 'CC -c lose.c -o lose.o');
    2131
    2232
    23 &touch('bar.c', 'lose.c');
    24 
    25 #   TEST #1
    26 #   -------
    27 
    28 &run_make_with_options($makefile, '', &get_logfile);
    29 $answer = "CC -c bar.c -o bar.o\n";
    30 &compare_output($answer, &get_logfile(1));
    31 
    32 
    33 #  TEST #2
    34 #  -------
    35 
    36 &run_make_with_options($makefile, 'lose.o', &get_logfile);
    37 $answer = "CC -c lose.c -o lose.o\n";
    38 &compare_output($answer, &get_logfile(1));
    39 
    40 
    41 #   TEST #3
     33#   TEST #2
    4234#   -------
    4335&touch("foo.el");
    4436
    45 &run_make_with_options($makefile, 'foo.elc', &get_logfile);
    46 $answer = "emacs foo.el\n";
    47 &compare_output($answer, &get_logfile(1));
     37run_make_test(undef, 'foo.elc', 'emacs foo.el');
    4838
    49 
     39# Clean up after the first tests.
    5040unlink('foo.el', 'bar.c', 'lose.c');
    5141
    5242
    53 # TEST #4 -- PR/1670: don't core dump on invalid static pattern rules
     43# TEST #3 -- PR/1670: don't core dump on invalid static pattern rules
    5444# -------
    5545
    56 $makefile2 = &get_tmpfile;
    57 open(MAKEFILE, "> $makefile2");
    58 print MAKEFILE "foo: foo%: % ; \@echo \$@\n";
    59 close(MAKEFILE);
     46run_make_test('
     47.DEFAULT: ; @echo $@
     48foo: foo%: % %.x % % % y.% % ; @echo $@
     49',
     50              '', ".x\ny.\nfoo");
    6051
    61 &run_make_with_options($makefile2, '', &get_logfile);
    62 $answer = "foo\n";
    63 &compare_output($answer, &get_logfile(1));
    6452
    65 # TEST #5 -- bug #12180: core dump on a stat pattern rule with an empty
     53# TEST #4 -- bug #12180: core dump on a stat pattern rule with an empty
    6654#                        prerequisite list.
    67 #
    6855run_make_test('
    6956foo.x bar.x: %.x : ; @echo $@
    7057
    7158',
     59              '', 'foo.x');
     60
     61
     62# TEST #5 -- bug #13881: double colon static pattern rule does not
     63#                        substitute %.
     64run_make_test('
     65foo.bar:: %.bar: %.baz
     66foo.baz: ;@:
     67',
     68              '', '');
     69
     70
     71# TEST #6: make sure the second stem does not overwrite the first
     72#          perprerequisite's stem (Savannah bug #16053).
     73#
     74run_make_test('
     75all.foo.bar: %.foo.bar: %.one
     76
     77all.foo.bar: %.bar: %.two
     78
     79all.foo.bar:
     80        @echo $*
     81        @echo $^
     82
     83.DEFAULT:;@:
     84',
    7285'',
    73 'foo.x
    74 ');
     86'all.foo
     87all.one all.foo.two');
     88
     89
     90# TEST #7: make sure the second stem does not overwrite the first
     91#          perprerequisite's stem when second expansion is enabled
     92#          (Savannah bug #16053).
     93#
     94run_make_test('
     95.SECONDEXPANSION:
     96
     97all.foo.bar: %.foo.bar: %.one $$*-one
     98
     99all.foo.bar: %.bar: %.two $$*-two
     100
     101all.foo.bar:
     102        @echo $*
     103        @echo $^
     104
     105.DEFAULT:;@:
     106',
     107'',
     108'all.foo
     109all.one all-one all.foo.two all.foo-two');
    75110
    761111;
  • vendor/gnumake/current/tests/scripts/features/targetvars

    r53 r501  
    268268&compare_output($answer, &get_logfile(1));
    269269
     270# TEST #17
     271
     272# Test a merge of set_lists for files, where one list is much longer
     273# than the other.  See Savannah bug #15757.
     274
     275mkdir('t1', 0777);
     276touch('t1/rules.mk');
     277
     278run_make_test('
     279VPATH = t1
     280include rules.mk
     281.PHONY: all
     282all: foo.x
     283foo.x : rules.mk ; @echo MYVAR=$(MYVAR) FOOVAR=$(FOOVAR) ALLVAR=$(ALLVAR)
     284all: ALLVAR = xxx
     285foo.x: FOOVAR = bar
     286rules.mk : MYVAR = foo
     287.INTERMEDIATE: foo.x rules.mk
     288',
     289              '-I t1',
     290              'MYVAR= FOOVAR=bar ALLVAR=xxx');
     291
     292rmfiles('t1/rules.mk');
     293rmdir('t1');
     294
     295# TEST #18
     296
     297# Test appending to a simple variable containing a "$": avoid a
     298# double-expansion.  See Savannah bug #15913.
     299
     300run_make_test("
     301VAR := \$\$FOO
     302foo: VAR += BAR
     303foo: ; \@echo '\$(VAR)'",
     304              '',
     305              '$FOO BAR');
     306
    2703071;
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