Ignore:
Timestamp:
Sep 15, 2006, 7:09:38 AM (19 years ago)
Author:
bird
Message:

Untested merge with GNU Make v3.81 (vendor/gnumake/2005-05-16 -> vendor/gnumake/current).

Location:
trunk/src/gmake/tests/scripts/misc
Files:
2 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/gmake/tests/scripts/misc/general3

    r53 r503  
    66break.";
    77
    8 $makefile2 = &get_tmpfile;
    9 
    10 open(MAKEFILE,"> $makefile");
    11 
    12 # The contents of the Makefile ...
    13 
    14 print MAKEFILE <<EOF;
     8run_make_test("
    159# We want to allow both empty commands _and_ commands that resolve to empty.
    1610EMPTY =
     
    3226\$(STR)
    3327
    34 \$(STR) \$(TAB)
    35 
    36 EOF
    37 
    38 close(MAKEFILE);
    39 
    40 &run_make_with_options($makefile,"",&get_logfile);
    41 $answer = "$make_name: Nothing to be done for `all'.\n";
    42 &compare_output($answer,&get_logfile(1));
    43 
     28\$(STR) \$(TAB)",
     29              '', "#MAKE#: Nothing to be done for `all'.");
    4430
    4531# TEST 2
    4632
    4733# Make sure files without trailing newlines are handled properly.
     34# Have to use the old style invocation to test this.
     35
     36$makefile2 = &get_tmpfile;
    4837
    4938open(MAKEFILE, "> $makefile2");
     
    5544&compare_output($answer,&get_logfile(1));
    5645
     46# TEST 3
     47
     48# Check semicolons in variable references
     49
     50run_make_test('
     51$(if true,$(info true; true))
     52all: ; @:
     53',
     54              '', 'true; true');
     55
     56# TEST 4
     57
     58# Check that backslashes in command scripts are handled according to POSIX.
     59# Checks Savannah bug # 1332.
     60
     61# Test the fastpath / no quotes
     62run_make_test('
     63all:
     64        @echo foo\
     65bar
     66        @echo foo\
     67        bar
     68        @echo foo\
     69    bar
     70        @echo foo\
     71            bar
     72        @echo foo \
     73bar
     74        @echo foo \
     75        bar
     76        @echo foo \
     77    bar
     78        @echo foo \
     79            bar
     80',
     81              '', 'foobar
     82foobar
     83foo bar
     84foo bar
     85foo bar
     86foo bar
     87foo bar
     88foo bar');
     89
     90# Test the fastpath / single quotes
     91run_make_test("
     92all:
     93        \@echo 'foo\\
     94bar'
     95        \@echo 'foo\\
     96        bar'
     97        \@echo 'foo\\
     98    bar'
     99        \@echo 'foo\\
     100            bar'
     101        \@echo 'foo \\
     102bar'
     103        \@echo 'foo \\
     104        bar'
     105        \@echo 'foo \\
     106    bar'
     107        \@echo 'foo \\
     108            bar'
     109",
     110              '', 'foo\
     111bar
     112foo\
     113bar
     114foo\
     115    bar
     116foo\
     117    bar
     118foo \
     119bar
     120foo \
     121bar
     122foo \
     123    bar
     124foo \
     125    bar');
     126
     127# Test the fastpath / double quotes
     128run_make_test('
     129all:
     130        @echo "foo\
     131bar"
     132        @echo "foo\
     133        bar"
     134        @echo "foo\
     135    bar"
     136        @echo "foo\
     137            bar"
     138        @echo "foo \
     139bar"
     140        @echo "foo \
     141        bar"
     142        @echo "foo \
     143    bar"
     144        @echo "foo \
     145            bar"
     146',
     147              '', 'foobar
     148foobar
     149foo    bar
     150foo    bar
     151foo bar
     152foo bar
     153foo     bar
     154foo     bar');
     155
     156# Test the slow path / no quotes
     157run_make_test('
     158all:
     159        @echo hi; echo foo\
     160bar
     161        @echo hi; echo foo\
     162        bar
     163        @echo hi; echo foo\
     164 bar
     165        @echo hi; echo foo\
     166         bar
     167        @echo hi; echo foo \
     168bar
     169        @echo hi; echo foo \
     170        bar
     171        @echo hi; echo foo \
     172 bar
     173        @echo hi; echo foo \
     174         bar
     175',
     176              '', 'hi
     177foobar
     178hi
     179foobar
     180hi
     181foo bar
     182hi
     183foo bar
     184hi
     185foo bar
     186hi
     187foo bar
     188hi
     189foo bar
     190hi
     191foo bar');
     192
     193# Test the slow path / no quotes.  This time we put the slow path
     194# determination _after_ the backslash-newline handling.
     195run_make_test('
     196all:
     197        @echo foo\
     198bar; echo hi
     199        @echo foo\
     200        bar; echo hi
     201        @echo foo\
     202 bar; echo hi
     203        @echo foo\
     204         bar; echo hi
     205        @echo foo \
     206bar; echo hi
     207        @echo foo \
     208        bar; echo hi
     209        @echo foo \
     210 bar; echo hi
     211        @echo foo \
     212         bar; echo hi
     213',
     214              '', 'foobar
     215hi
     216foobar
     217hi
     218foo bar
     219hi
     220foo bar
     221hi
     222foo bar
     223hi
     224foo bar
     225hi
     226foo bar
     227hi
     228foo bar
     229hi');
     230
     231# Test the slow path / single quotes
     232run_make_test("
     233all:
     234        \@echo hi; echo 'foo\\
     235bar'
     236        \@echo hi; echo 'foo\\
     237        bar'
     238        \@echo hi; echo 'foo\\
     239    bar'
     240        \@echo hi; echo 'foo\\
     241            bar'
     242        \@echo hi; echo 'foo \\
     243bar'
     244        \@echo hi; echo 'foo \\
     245        bar'
     246        \@echo hi; echo 'foo \\
     247    bar'
     248        \@echo hi; echo 'foo \\
     249            bar'
     250",
     251              '', 'hi
     252foo\
     253bar
     254hi
     255foo\
     256bar
     257hi
     258foo\
     259    bar
     260hi
     261foo\
     262    bar
     263hi
     264foo \
     265bar
     266hi
     267foo \
     268bar
     269hi
     270foo \
     271    bar
     272hi
     273foo \
     274    bar');
     275
     276# Test the slow path / double quotes
     277run_make_test('
     278all:
     279        @echo hi; echo "foo\
     280bar"
     281        @echo hi; echo "foo\
     282        bar"
     283        @echo hi; echo "foo\
     284    bar"
     285        @echo hi; echo "foo\
     286            bar"
     287        @echo hi; echo "foo \
     288bar"
     289        @echo hi; echo "foo \
     290        bar"
     291        @echo hi; echo "foo \
     292    bar"
     293        @echo hi; echo "foo \
     294            bar"
     295',
     296              '', 'hi
     297foobar
     298hi
     299foobar
     300hi
     301foo    bar
     302hi
     303foo    bar
     304hi
     305foo bar
     306hi
     307foo bar
     308hi
     309foo     bar
     310hi
     311foo     bar');
    57312
    583131;
  • trunk/src/gmake/tests/scripts/misc/general4

    r285 r503  
    66break.";
    77
    8 open(MAKEFILE,"> $makefile");
    9 print MAKEFILE <<'EOF';
     8run_make_test('
    109# Make sure that subdirectories built as prerequisites are actually handled
    1110# properly.
     
    1716dir/subdir/file.b: dir/subdir ; @echo touch dir/subdir/file.b
    1817
    19 dir/subdir/%.a: dir/subdir/%.b ; @echo cp $< $@
    20 EOF
    21 close(MAKEFILE);
    22 
    23 &run_make_with_options($makefile,"",&get_logfile);
    24 $answer = "mkdir -p dir/subdir\ntouch dir/subdir/file.b\ncp dir/subdir/file.b dir/subdir/file.a\n";
    25 &compare_output($answer,&get_logfile(1));
     18dir/subdir/%.a: dir/subdir/%.b ; @echo cp $< $@',
     19              '', "mkdir -p dir/subdir\ntouch dir/subdir/file.b\ncp dir/subdir/file.b dir/subdir/file.a\n");
    2620
    2721# Test implicit rules
     
    4842unlink('bar');
    4943
     44
     45# Test implicit rules with '$' in the name (see se_implicit)
     46
     47run_make_test(q!
     48%.foo : baz$$bar ; @echo 'done $<'
     49%.foo : bar$$baz ; @echo 'done $<'
     50test.foo:
     51baz$$bar bar$$baz: ; @echo '$@'
     52!,
     53              '',
     54              "baz\$bar\ndone baz\$bar");
     55
     56
     57# Test implicit rules with '$' in the name (see se_implicit)
     58# Use the '$' in the pattern.
     59
     60run_make_test(q!
     61%.foo : %$$bar ; @echo 'done $<'
     62test.foo:
     63test$$bar: ; @echo '$@'
     64!,
     65              '',
     66              "test\$bar\ndone test\$bar");
     67
     68# Make sure that subdirectories built as prerequisites are actually handled
     69# properly... this time with '$'
     70
     71run_make_test(q!
     72
     73all: dir/subdir/file.$$a
     74
     75dir/subdir: ; @echo mkdir -p '$@'
     76
     77dir/subdir/file.$$b: dir/subdir ; @echo touch '$@'
     78
     79dir/subdir/%.$$a: dir/subdir/%.$$b ; @echo 'cp $< $@'
     80!,
     81              '', "mkdir -p dir/subdir\ntouch dir/subdir/file.\$b\ncp dir/subdir/file.\$b dir/subdir/file.\$a\n");
     82
    50831;
Note: See TracChangeset for help on using the changeset viewer.