Ignore:
Timestamp:
Jun 17, 2012, 10:45:31 PM (13 years ago)
Author:
bird
Message:

kmk: Merged in changes from GNU make 3.82. Previous GNU make base version was gnumake-2008-10-28-CVS.

Location:
trunk/src/kmk
Files:
15 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk

    • Property svn:ignore
      •  

        old new  
        1313stamp-*
        1414makebook*
         15
        1516.*gdbinit
         17.gdb_history
         18
        1619*.dep
        1720*.dvi
         
        3134*.pg
        3235*.pgs
         36
        3337README
        3438README.DOS
        3539README.W32
         40README.OS2
        3641aclocal.m4
        3742autom4te.cache
         
        5257config.h.W32
        5358config.h-vms
         59
        5460loadavg
        5561loadavg.c
        5662make
         63
        5764.deps
        5865.dep_segment
         66ID
         67TAGS
         68
        5969_*
        6070sun4
         
        7282sol2
        7383i486-linux
         84
        7485customs
         86
        7587install-sh
        7688mkinstalldirs
         89
         90.directive.asc
  • trunk/src/kmk/tests

    • Property svn:ignore
      --- 
      +++ 
      
  • trunk/src/kmk/tests/scripts/features/echoing

    r969 r2591  
    1 $description = "The following test creates a makefile to test command \n"
    2               ."echoing.  It tests that when a command line starts with \n"
    3               ."a '\@', the echoing of that line is suppressed.  It also \n"
    4               ."tests the -n option which tells make to ONLY echo the  \n"
    5               ."commands and no execution happens.  In this case, even \n"
    6               ."the commands with '\@' are printed. Lastly, it tests the \n"
    7               ."-s flag which tells make to prevent all echoing, as if \n"
    8               ."all commands started with a '\@'.";
     1#                                                                    -*-perl-*-
     2$description = "The following test creates a makefile to test command
     3echoing.  It tests that when a command line starts with
     4a '\@', the echoing of that line is suppressed.  It also
     5tests the -n option which tells make to ONLY echo the
     6commands and no execution happens.  In this case, even
     7the commands with '\@' are printed. Lastly, it tests the
     8-s flag which tells make to prevent all echoing, as if
     9all commands started with a '\@'.";
    910
    10 $details = "This test is similar to the 'clean' test except that a '\@' has\n"
    11           ."been placed in front of the delete command line.  Four tests \n"
    12           ."are run here.  First, make is run normally and the first echo\n"
    13           ."command should be executed.  In this case there is no '\@' so \n"
    14           ."we should expect make to display the command AND display the \n"
    15           ."echoed message.  Secondly, make is run with the clean target, \n"
    16           ."but since there is a '\@' at the beginning of the command, we\n"
    17           ."expect no output; just the deletion of a file which we check \n"
    18           ."for.  Third, we give the clean target again except this time\n"
    19           ."we give make the -n option.  We now expect the command to be \n"
    20           ."displayed but not to be executed.  In this case we need only \n"
    21           ."to check the output since an error message would be displayed\n"
    22           ."if it actually tried to run the delete command again and the \n"
    23           ."file didn't exist. Lastly, we run the first test again with \n"
    24           ."the -s option and check that make did not echo the echo \n"
    25           ."command before printing the message.";
     11$details = "This test is similar to the 'clean' test except that a '\@' has
     12been placed in front of the delete command line.  Four tests
     13are run here.  First, make is run normally and the first echo
     14command should be executed.  In this case there is no '\@' so
     15we should expect make to display the command AND display the
     16echoed message.  Secondly, make is run with the clean target,
     17but since there is a '\@' at the beginning of the command, we
     18expect no output; just the deletion of a file which we check
     19for.  Third, we give the clean target again except this time
     20we give make the -n option.  We now expect the command to be
     21displayed but not to be executed.  In this case we need only
     22to check the output since an error message would be displayed
     23if it actually tried to run the delete command again and the
     24file didn't exist. Lastly, we run the first test again with
     25the -s option and check that make did not echo the echo
     26command before printing the message.\n";
    2627
    2728$example = "EXAMPLE_FILE";
    2829
    29 open(MAKEFILE,"> $makefile");
    30 
    31 # The Contents of the MAKEFILE ...
    32 
    33 print MAKEFILE "all: \n";
    34 print MAKEFILE "\techo This makefile did not clean the dir... good\n";
    35 print MAKEFILE "clean: \n";
    36 print MAKEFILE "\t\@$delete_command $example\n";
    37 
    38 # END of Contents of MAKEFILE
    39 
    40 close(MAKEFILE);
    41 
    42 &touch($example);
     30touch($example);
    4331
    4432# TEST #1
    4533# -------
    4634
    47 &run_make_with_options($makefile,"",&get_logfile,0);
    48 $answer = "echo This makefile did not clean the dir... good\n"
    49          ."This makefile did not clean the dir... good\n";
    50 &compare_output($answer,&get_logfile(1));
    51 
     35run_make_test("
     36all:
     37\techo This makefile did not clean the dir... good
     38clean:
     39\t\@$delete_command $example\n",
     40              '', 'echo This makefile did not clean the dir... good
     41This makefile did not clean the dir... good');
    5242
    5343# TEST #2
    5444# -------
    5545
    56 &run_make_with_options($makefile,"clean",&get_logfile,0);
     46run_make_test(undef, 'clean', '');
    5747if (-f $example) {
    5848  $test_passed = 0;
     49  unlink($example);
    5950}
    60 &compare_output('',&get_logfile(1));
    6151
    6252# TEST #3
    6353# -------
    6454
    65 &run_make_with_options($makefile,"-n clean",&get_logfile,0);
    66 $answer = "$delete_command $example\n";
    67 &compare_output($answer,&get_logfile(1));
     55run_make_test(undef, '-n clean', "$delete_command $example\n");
    6856
    6957
     
    7159# -------
    7260
    73 &run_make_with_options($makefile,"-s",&get_logfile,0);
    74 $answer = "This makefile did not clean the dir... good\n";
    75 &compare_output($answer,&get_logfile(1));
     61run_make_test(undef, '-s', "This makefile did not clean the dir... good\n");
    7662
    7763
    78641;
    79 
    80 
    81 
    82 
    83 
    84 
    85 
    86 
    87 
  • trunk/src/kmk/tests/scripts/features/export

    r969 r2591  
    77# about that here.
    88
    9 open(MAKEFILE,"> $makefile");
    10 
    11 # The Contents of the MAKEFILE ...
    12 
    13 print MAKEFILE <<'EOMAKE';
    14 
     9&run_make_test('
    1510FOO = foo
    1611BAR = bar
     
    4136        @echo "FOO=$(FOO) BAR=$(BAR) BAZ=$(BAZ) BOZ=$(BOZ) BITZ=$(BITZ) BOTZ=$(BOTZ)"
    4237        @echo "FOO=$$FOO BAR=$$BAR BAZ=$$BAZ BOZ=$$BOZ BITZ=$$BITZ BOTZ=$$BOTZ"
    43 
    44 EOMAKE
    45 
    46 close(MAKEFILE);
    47 
    48 # TEST 0: basics
    49 
    50 &run_make_with_options($makefile,"",&get_logfile,0);
    51 
    52 $answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
    53 FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
    54 
    55 &compare_output($answer,&get_logfile(1));
     38',
     39           '', "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
     40FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
    5641
    5742# TEST 1: make sure vars inherited from the parent are exported
     
    5944$extraENV{FOO} = 1;
    6045
    61 &run_make_with_options($makefile,"",&get_logfile,0);
    62 
    63 $answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
    64 FOO=foo BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
    65 
    66 &compare_output($answer,&get_logfile(1));
     46&run_make_test(undef, '', "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
     47FOO=foo BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
    6748
    6849# TEST 2: global export.  Explicit unexport takes precedence.
    6950
    70 &run_make_with_options($makefile,"EXPORT_ALL=1",&get_logfile,0);
    71 
    72 $answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
    73 FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
    74 
    75 &compare_output($answer,&get_logfile(1));
     51run_make_test(undef, "EXPORT_ALL=1" ,
     52              "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
     53FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
    7654
    7755# TEST 3: global unexport.  Explicit export takes precedence.
    7856
    79 &run_make_with_options($makefile,"UNEXPORT_ALL=1",&get_logfile,0);
    80 
    81 $answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
    82 FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
    83 
    84 &compare_output($answer,&get_logfile(1));
     57&run_make_test(undef, "UNEXPORT_ALL=1",
     58               "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
     59FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
    8560
    8661# TEST 4: both: in the above makefile the unexport comes last so that rules.
    8762
    88 &run_make_with_options($makefile,"EXPORT_ALL=1 UNEXPORT_ALL=1",&get_logfile,0);
    89 
    90 $answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
    91 FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
    92 
    93 &compare_output($answer,&get_logfile(1));
     63&run_make_test(undef, "EXPORT_ALL=1 UNEXPORT_ALL=1",
     64               "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
     65FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
    9466
    9567# TEST 5: test the pseudo target.
    9668
    97 &run_make_with_options($makefile,"EXPORT_ALL_PSEUDO=1",&get_logfile,0);
    98 
    99 $answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
    100 FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
    101 
    102 &compare_output($answer,&get_logfile(1));
    103 
     69&run_make_test(undef, "EXPORT_ALL_PSEUDO=1",
     70               "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
     71FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
    10472
    10573# TEST 6: Test the expansion of variables inside export
    10674
    107 $makefile2 = &get_tmpfile;
    108 
    109 open(MAKEFILE, "> $makefile2");
    110 
    111 print MAKEFILE <<'EOF';
    112 
     75&run_make_test('
    11376foo = f-ok
    11477bar = b-ok
     
    12689        @echo foo=$(foo) bar=$(bar)
    12790        @echo foo=$$foo bar=$$bar
    128 
    129 EOF
    130 
    131 close(MAKEFILE);
    132 
    133 &run_make_with_options($makefile2,"",&get_logfile,0);
    134 $answer = "foo=f-ok bar=b-ok\nfoo=f-ok bar=b-ok\n";
    135 &compare_output($answer,&get_logfile(1));
    136 
     91',
     92             "", "foo=f-ok bar=b-ok\nfoo=f-ok bar=b-ok\n");
    13793
    13894# TEST 7: Test the expansion of variables inside unexport
    13995
    140 $makefile3 = &get_tmpfile;
    141 
    142 open(MAKEFILE, "> $makefile3");
    143 
    144 print MAKEFILE <<'EOF';
    145 
     96&run_make_test('
    14697foo = f-ok
    14798bar = b-ok
     
    161112        @echo foo=$(foo) bar=$(bar)
    162113        @echo foo=$$foo bar=$$bar
    163 
    164 EOF
    165 
    166 close(MAKEFILE);
    167 
    168 &run_make_with_options($makefile3,"",&get_logfile,0);
    169 $answer = "foo=f-ok bar=b-ok\nfoo= bar=\n";
    170 &compare_output($answer,&get_logfile(1));
    171 
     114',
     115              '', "foo=f-ok bar=b-ok\nfoo= bar=\n");
    172116
    173117# TEST 7: Test exporting multiple variables on the same line
    174118
    175 $makefile4 = &get_tmpfile;
    176 
    177 open(MAKEFILE, "> $makefile4");
    178 
    179 print MAKEFILE <<'EOF';
    180 
     119&run_make_test('
    181120A = a
    182121B = b
     
    197136
    198137all: ; @echo A=$$A B=$$B C=$$C D=$$D E=$$E F=$$F G=$$G H=$$H I=$$I J=$$J
    199 EOF
    200 
    201 close(MAKEFILE);
    202 
    203 &run_make_with_options($makefile4,"",&get_logfile,0);
    204 $answer = "A=a B=b C=c D=d E=e F=f G=g H=h I=i J=j\n";
    205 &compare_output($answer,&get_logfile(1));
    206 
     138',
     139               '', "A=a B=b C=c D=d E=e F=f G=g H=h I=i J=j\n");
    207140
    208141# TEST 8: Test unexporting multiple variables on the same line
    209142
    210 $makefile5 = &get_tmpfile;
     143@extraENV{qw(A B C D E F G H I J)} = qw(1 2 3 4 5 6 7 8 9 10);
    211144
    212 open(MAKEFILE, "> $makefile5");
    213 
    214 print MAKEFILE <<'EOF';
    215 
     145&run_make_test('
    216146A = a
    217147B = b
     
    232162
    233163all: ; @echo A=$$A B=$$B C=$$C D=$$D E=$$E F=$$F G=$$G H=$$H I=$$I J=$$J
    234 EOF
     164',
     165               '', "A= B= C= D= E= F= G= H= I= J=\n");
    235166
    236 close(MAKEFILE);
     167# TEST 9: Check setting a variable named "export"
    237168
    238 @extraENV{qw(A B C D E F G H I J)} = qw(1 2 3 4 5 6 7 8 9 10);
     169&run_make_test('
     170export = 123
     171export export
     172export export = 456
     173a: ; @echo "\$$(export)=$(export) / \$$export=$$export"
     174',
     175               '', "\$(export)=456 / \$export=456\n");
    239176
    240 &run_make_with_options($makefile5,"",&get_logfile,0);
    241 $answer = "A= B= C= D= E= F= G= H= I= J=\n";
    242 &compare_output($answer,&get_logfile(1));
     177# TEST 9: Check "export" as a target
    243178
     179&run_make_test('
     180a: export
     181export: ; @echo "$@"
     182',
     183               '', "export\n");
    244184
    245185# This tells the test driver that the perl test script executed properly.
  • trunk/src/kmk/tests/scripts/features/include

    r969 r2591  
    9191', '', '');
    9292
    93 1;
    94 
    9593
    9694# Make sure that we don't die when the command fails but we dontcare.
     
    118116sinclude', '', '');
    119117
     118
     119# Test that the diagnostics is issued even if the target has been
     120# tried before with the dontcare flag (direct dependency case).
     121#
     122run_make_test('
     123-include foo
     124
     125all: bar
     126
     127foo: baz
     128bar: baz
     129',
     130'',
     131"#MAKE#: *** No rule to make target `baz', needed by `bar'.  Stop.\n",
     132512);
     133
     134# Test that the diagnostics is issued even if the target has been
     135# tried before with the dontcare flag (indirect dependency case).
     136#
     137run_make_test('
     138-include foo
     139
     140all: bar
     141
     142foo: baz
     143bar: baz
     144baz: end
     145',
     146'',
     147"#MAKE#: *** No rule to make target `end', needed by `baz'.  Stop.\n",
     148512);
     149
     150# Test that the diagnostics is issued even if the target has been
     151# tried before with the dontcare flag (include/-include case).
     152#
     153run_make_test('
     154include bar
     155-include foo
     156
     157all:
     158
     159foo: baz
     160bar: baz
     161baz: end
     162',
     163'',
     164"#MAKEFILE#:2: bar: No such file or directory
     165#MAKE#: *** No rule to make target `end', needed by `baz'.  Stop.\n",
     166512);
     167
     168if ($all_tests) {
     169    # Test that include of a rebuild-able file doesn't show a warning
     170    # Savannah bug #102
     171    run_make_test(q!
     172include foo
     173foo: ; @echo foo = bar > $@
     174!,
     175                  '', "#MAKE#: `foo' is up to date.\n");
     176    rmfiles('foo');
     177}
     178
    1201791;
  • trunk/src/kmk/tests/scripts/features/override

    r969 r2591  
    1 $description = "The following test creates a makefile to ...";
     1#                                                                    -*-perl-*-
     2
     3$description = "Test the override directive on variable assignments.";
    24
    35$details = "";
    46
    5 open(MAKEFILE,"> $makefile");
     7# TEST 0: Basic override
    68
    7 # The Contents of the MAKEFILE ...
     9run_make_test('
     10X = start
     11override recur = $(X)
     12override simple := $(X)
     13X = end
     14all: ; @echo "$(recur) $(simple)"
     15',
     16              'recur=I simple=J', "end start\n");
    817
    9 print MAKEFILE "override define foo\n"
    10               ."\@echo First comes the definition.\n"
    11               ."\@echo Then comes the override.\n"
    12               ."endef\n"
    13               ."all: \n"
    14               ."\t\$(foo)\n";
     18# TEST 1: Override with append
    1519
    16 # END of Contents of MAKEFILE
     20run_make_test('
     21X += X1
     22override X += X2
     23override Y += Y1
     24Y += Y2
     25all: ; @echo "$(X) $(Y)"
     26',
     27              '', "X1 X2 Y1\n");
    1728
    18 close(MAKEFILE);
     29# TEST 2: Override with append to the command line
    1930
    20 &run_make_with_options($makefile,"foo=Hello",&get_logfile);
     31run_make_test(undef, 'X=C Y=C', "C X2 C Y1\n");
    2132
    22 # Create the answer to what should be produced by this Makefile
    23 $answer = "First comes the definition.\n"
    24          ."Then comes the override.\n";
     33# Test override of define/endef
    2534
    26 &compare_output($answer,&get_logfile(1));
     35run_make_test('
     36override define foo
     37@echo First comes the definition.
     38@echo Then comes the override.
     39endef
     40all: ; $(foo)
     41',
     42              'foo=Hello', "First comes the definition.\nThen comes the override.\n");
     43
    2744
    28451;
    29 
    30 
    31 
    32 
    33 
    34 
  • trunk/src/kmk/tests/scripts/features/parallelism

    r2186 r2591  
    4444              "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n");
    4545
    46 unlink('1.inc', '2.inc');
     46rmfiles(qw(1.inc 2.inc));
    4747
    4848
     
    6363              "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n");
    6464
    65 unlink('1.inc', '2.inc');
     65rmfiles(qw(1.inc 2.inc));
    6666
    6767# Grant Taylor reports a problem where tokens can be lost (not written back
     
    153153.PHONY: phony
    154154phony: ; : phony', '-rR -j', ': phony');
    155 unlink('target');
    156 
     155rmfiles('target');
     156
     157# TEST #10: Don't put --jobserver-fds into a re-exec'd MAKEFLAGS.
     158# We can't test this directly because there's no way a makefile can
     159# show the value of MAKEFLAGS we were re-exec'd with.  We can intuit it
     160# by looking for "disabling jobserver mode" warnings; we should only
     161# get one from the original invocation and none from the re-exec.
     162# See Savannah bug #18124
     163
     164run_make_test(q!
     165-include inc.mk
     166recur:
     167#       @echo 'MAKEFLAGS = $(MAKEFLAGS)'
     168        @rm -f inc.mk
     169        @$(MAKE) -j2 -f #MAKEFILE# all
     170all:
     171#       @echo 'MAKEFLAGS = $(MAKEFLAGS)'
     172        @echo $@
     173inc.mk:
     174#       @echo 'MAKEFLAGS = $(MAKEFLAGS)'
     175        @echo 'FOO = bar' > $@
     176!,
     177              '--no-print-directory -j2', "#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.\nall\n");
     178
     179rmfiles('inc.mk');
     180
     181if ($all_tests) {
     182    # Implicit files aren't properly recreated during parallel builds
     183    # Savannah bug #26864
     184
     185    # The first run works fine
     186    run_make_test(q!
     187%.bar: %.x foo.y ; cat $^ > $@
     188%.x: ; touch $@
     189foo.y: foo.y.in ; cp $< $@
     190foo.y.in: ; touch $@
     191!,
     192                  '-j2 main.bar',
     193                  "touch foo.y.in
     194touch main.x
     195cp foo.y.in foo.y
     196cat main.x foo.y > main.bar
     197rm main.x");
     198
     199    # Now we touch the .in file and make sure it still works
     200    touch('foo.y.in');
     201
     202    run_make_test(undef, '-j2 main.bar', "cp foo.y.in foo.y
     203touch main.x
     204cat main.x foo.y > main.bar
     205rm main.x");
     206
     207    # Clean up
     208    rmfiles(qw(foo.y foo.y.in main.bar));
     209}
     210
     211if ($all_tests) {
     212    # Jobserver FD handling is messed up in some way.
     213    # Savannah bug #28189
     214    # It doesn't look like that bug anymore but this is the code it runs
     215
     216    run_make_test(q!
     217ifdef EXTRA
     218vpath %.dst /
     219xxx.dst: ; true
     220yyy.dst: ; true
     221endif
     222
     223M := $(MAKE)
     224xx: ; $M --no-print-directory -j2 -f $(MAKEFILE_LIST) xxx.dst yyy.dst EXTRA=1
     225!,
     226                  '-j2',
     227                  '#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.
     228true
     229true
     230');
     231}
    157232
    158233# Make sure that all jobserver FDs are closed if we need to re-exec the
     
    183258#               'bar');
    184259
    185 # unlink('dependfile', 'output');
     260# rmfiles(qw(dependfile output));
    186261
    187262
     
    189264# run_make_test(undef, '-j2 recurse INCL=false', 'bar');
    190265
    191 # unlink('dependfile', 'output');
     266# rmfiles(qw(dependfile output));
    192267
    1932681;
  • trunk/src/kmk/tests/scripts/features/patspecific_vars

    r2173 r2591  
    121121pattrn: global: new $t pattern: good $t inherit: good $t;');
    122122
     123# TEST #8: override in pattern-specific variables
     124
     125run_make_test('
     126a%: override FOO += f1
     127a%: FOO += f2
     128ab: ; @echo "$(FOO)"
     129',
     130              '', "f1\n");
     131
     132run_make_test(undef, 'FOO=C', "C f1\n");
     133
     134# TEST #9: Test shortest stem selection in pattern-specific variables.
     135
     136run_make_test('
     137%-mt.x: x := two
     138%.x: x := one
     139
     140all: foo.x foo-mt.x
     141
     142foo.x: ;@echo $x
     143foo-mt.x: ;@echo $x
     144',
     145'',
     146"one\ntwo");
    123147
    1241481;
  • trunk/src/kmk/tests/scripts/features/patternrules

    • Property svn:keywords deleted
    r1952 r2591  
    1616#
    1717
    18 run_make_test('
     18run_make_test(q!
    1919.PHONY: all
    2020
    2121all: case.1 case.2 case.3
    22 a: void
     22
     23# We can't have this, due to "Implicit Rule Search Algorithm" step 5c
     24#xxx: void
    2325
    2426# 1 - existing file
     
    4244
    43453.implicit-phony:
    44 ',
    45 '',
    46 '');
     46!, '', '');
    4747
    4848# TEST #1: make sure files that are built via implicit rules are marked
     
    150150unlink('foo.in', 'foo.h', 'foo.c', 'foo.o');
    151151
     152# TEST #5: make sure both prefix and suffix patterns work with multiple
     153#          target patterns (Savannah bug #26593).
     154#
     155run_make_test('
     156all: foo.s1 foo.s2 p1.foo p2.foo
     157
     158p1.% p2.%: %.orig
     159        @echo $@
     160%.s1 %.s2: %.orig
     161        @echo $@
     162
     163.PHONY: foo.orig
     164',
     165              '', "foo.s1\np1.foo\n");
     166
     167# TEST 6: Make sure that non-target files are still eligible to be created
     168# as part of implicit rule chaining.  Savannah bug #17752.
     169
     170run_make_test(q!
     171BIN = xyz
     172COPY = $(BIN).cp
     173SRC = $(BIN).c
     174allbroken: $(COPY) $(BIN) ; @echo ok
     175$(SRC): ; @echo 'main(){}' > $@
     176%.cp: % ; @cp $< $@
     177% : %.c ; @cp $< $@
     178clean: ; @rm -rf $(SRC) $(COPY) $(BIN)
     179!,
     180              '', "ok\n");
     181
     182unlink(qw(xyz xyz.cp xyz.c));
     183
     184# TEST 7: Make sure that all prereqs of all "also_make" targets get created
     185# before any of the things that depend on any of them.  Savannah bug #19108.
     186
     187run_make_test(q!
     188final: x ; @echo $@
     189x: x.t1 x.t2 ; @echo $@
     190x.t2: dep
     191dep: ; @echo $@
     192%.t1 %.t2: ; @echo $*.t1 ; echo $*.t2
     193!,
     194              '', "dep\nx.t1\nx.t2\nx\nfinal\n");
     195
     196
     197# TEST 8: Verify we can remove pattern rules.  Savannah bug #18622.
     198
     199my @f = (qw(foo.w foo.ch));
     200touch(@f);
     201
     202run_make_test(q!
     203CWEAVE := :
     204
     205# Disable builtin rules
     206%.tex : %.w
     207%.tex : %.w %.ch
     208!,
     209              'foo.tex',
     210              "#MAKE#: *** No rule to make target `foo.tex'.  Stop.", 512);
     211
     212unlink(@f);
     213
     214# TEST #9: Test shortest stem selection in pattern rules.
     215
     216run_make_test('
     217%.x: ;@echo one
     218%-mt.x: ;@echo two
     219
     220all: foo.x foo-mt.x
     221',
     222'',
     223"one\ntwo");
     224
     2251;
     226
    152227# This tells the test driver that the perl test script executed properly.
    1532281;
  • trunk/src/kmk/tests/scripts/features/recursion

    r1956 r2591  
    1717        @echo THE END
    1818',
    19               ('CFLAGS=-O -w' . ($parallel_jobs ? '-j 2' : '')),
     19              ('CFLAGS=-O -w' . ($parallel_jobs ? ' -j 2' : '')),
    2020              ($vos
    2121               ? "#MAKE#: Entering directory `#PWD#'
  • trunk/src/kmk/tests/scripts/features/se_explicit

    • Property svn:keywords deleted
    r1981 r2591  
    2727# TEST #1: automatic variables.
    2828#
    29 run_make_test('
     29run_make_test(q!
    3030.SECONDEXPANSION:
    31 .DEFAULT: ; @echo $@
     31.DEFAULT: ; @echo '$@'
    3232
    3333foo: bar baz
     
    4242     $$*.6
    4343
    44 ',
     44!,
    4545'-j1',
    4646'bar
     
    6363# Test #2: target/pattern -specific variables.
    6464#
    65 run_make_test('
     65run_make_test(q!
    6666.SECONDEXPANSION:
    67 .DEFAULT: ; @echo $@
     67.DEFAULT: ; @echo '$@'
    6868
    6969foo.x: $$a $$b
     
    7272
    7373%.x: b := baz
    74 
    75 ',
     74!,
    7675'',
    7776'bar
     
    8281# Test #3: order of prerequisites.
    8382#
    84 run_make_test('
     83run_make_test(q!
    8584.SECONDEXPANSION:
    86 .DEFAULT: ; @echo $@
     85.DEFAULT: ; @echo '$@'
    8786
    8887all: foo bar baz
    8988
    9089# Subtest #1
    91 #
    9290foo: foo.1; @:
    93 
    9491foo: foo.2
    95 
    9692foo: foo.3
    9793
    98 
    9994# Subtest #2
    100 #
    10195bar: bar.2
    102 
    10396bar: bar.1; @:
    104 
    10597bar: bar.3
    10698
    107 
    10899# Subtest #3
    109 #
    110100baz: baz.1
    111 
    112101baz: baz.2
    113 
    114102baz: ; @:
    115 
    116 ',
     103!,
    117104'-j1',
    118105'foo.1
     
    126113');
    127114
     115# TEST #4: eval in a context where there is no reading_file
     116run_make_test(q!
     117.SECONDEXPANSION:
     118all : $$(eval $$(info test))
     119!,
     120            '', "test\n#MAKE#: Nothing to be done for `all'.\n");
     121
     122# TEST #5: (NEGATIVE) catch eval in a prereq list trying to create new
     123# target/prereq relationships.
     124
     125run_make_test(q!
     126.SECONDEXPANSION:
     127proj1.exe : proj1.o $$(eval $$(test))
     128define test
     129proj1.o : proj1.c
     130proj1.c: proj1.h
     131endef
     132!,
     133              '', "#MAKE#: *** prerequisites cannot be defined in recipes.  Stop.\n", 512);
     134
     135
     136# Automatic $$+ variable expansion issue.  Savannah bug #25780
     137run_make_test(q!
     138all : foo foo
     139.SECONDEXPANSION:
     140all : $$+ ; @echo '$+'
     141foo : ;
     142!,
     143                  '', "foo foo foo foo\n");
     144
     145
     146# Automatic $$+ variable expansion issue.  Savannah bug #25780
     147run_make_test(q!
     148all : bar bar
     149bar : ;
     150q%x : ;
     151.SECONDEXPANSION:
     152a%l: q1x $$+ q2x ; @echo '$+'
     153!,
     154                  '', "q1x bar bar q2x bar bar\n");
     155
     156
    128157# This tells the test driver that the perl test script executed properly.
    1291581;
  • trunk/src/kmk/tests/scripts/features/se_implicit

    • Property svn:keywords deleted
    r1982 r2591  
    1212# Test #1: automatic variables.
    1313#
    14 run_make_test('
    15 .SECONDEXPANSION:
    16 .DEFAULT: ; @echo $@
     14run_make_test(q!
     15.SECONDEXPANSION:
     16.DEFAULT: ; @echo '$@'
    1717
    1818foo.a: bar baz
     
    38385.buz \
    39396.a:
    40         @echo $@
    41 
    42 ',
     40        @echo '$@'
     41
     42!,
    4343'-j1',
    4444'1.foo.a
     
    6161# Test #2: target/pattern -specific variables.
    6262#
    63 run_make_test('
     63run_make_test(q!
    6464.SECONDEXPANSION:
    6565foo.x:
     
    7272%.x: x_b := baz
    7373
    74 bar baz: ; @echo $@
    75 
    76 ',
    77 '',
    78 'bar
    79 baz
    80 ');
     74bar baz: ; @echo '$@'
     75!,
     76              '', "bar\nbaz\n");
    8177
    8278
    8379# Test #3: order of prerequisites.
    8480#
    85 run_make_test('
    86 .SECONDEXPANSION:
    87 .DEFAULT: ; @echo $@
     81run_make_test(q!
     82.SECONDEXPANSION:
     83.DEFAULT: ; @echo '$@'
    8884
    8985all: foo bar baz
     
    9894foo: foo.3
    9995
    100 foo.1: ; @echo $@
     96foo.1: ; @echo '$@'
    10197
    10298
     
    109105bar: bar.3
    110106
    111 bar.1: ; @echo $@
     107bar.1: ; @echo '$@'
    112108
    113109
     
    119115
    120116%az: ; @:
    121 
    122 ',
    123 '-j1',
     117!,
     118              '-j1',
    124119'foo.1
    125120foo.2
     
    135130# Test #4: stem splitting logic.
    136131#
    137 run_make_test('
     132run_make_test(q!
    138133.SECONDEXPANSION:
    139134$(dir)/tmp/bar.o:
    140135
    141 $(dir)/tmp/foo/bar.c: ; @echo $@
    142 $(dir)/tmp/bar/bar.c: ; @echo $@
    143 foo.h: ; @echo $@
     136$(dir)/tmp/foo/bar.c: ; @echo '$@'
     137$(dir)/tmp/bar/bar.c: ; @echo '$@'
     138foo.h: ; @echo '$@'
    144139
    145140%.o: $$(addsuffix /%.c,foo bar) foo.h
    146         @echo $@: {$<} $^
    147 
    148 ',
    149 "dir=$dir",
    150 "$dir/tmp/foo/bar.c
     141        @echo '$@: {$<} $^'
     142!,
     143              "dir=$dir", "$dir/tmp/foo/bar.c
    151144$dir/tmp/bar/bar.c
    152145foo.h
     
    157150# Test #5: stem splitting logic and order-only prerequisites.
    158151#
    159 run_make_test('
     152run_make_test(q!
    160153.SECONDEXPANSION:
    161154$(dir)/tmp/foo.o: $(dir)/tmp/foo.c
    162 $(dir)/tmp/foo.c: ; @echo $@
    163 bar.h: ; @echo $@
     155$(dir)/tmp/foo.c: ; @echo '$@'
     156bar.h: ; @echo '$@'
    164157
    165158%.o: %.c|bar.h
    166         @echo $@: {$<} {$|} $^
    167 
    168 ',
    169 "dir=$dir",
    170 "$dir/tmp/foo.c
     159        @echo '$@: {$<} {$|} $^'
     160
     161!,
     162              "dir=$dir", "$dir/tmp/foo.c
    171163bar.h
    172164$dir/tmp/foo.o: {$dir/tmp/foo.c} {bar.h} $dir/tmp/foo.c
     
    176168# Test #6: lack of implicit prerequisites.
    177169#
    178 run_make_test('
     170run_make_test(q!
    179171.SECONDEXPANSION:
    180172foo.o: foo.c
    181 foo.c: ; @echo $@
     173foo.c: ; @echo '$@'
    182174
    183175%.o:
    184         @echo $@: {$<} $^
    185 
    186 ',
    187 '',
    188 'foo.c
    189 foo.o: {foo.c} foo.c
    190 ');
     176        @echo '$@: {$<} $^'
     177!,
     178              '', "foo.c\nfoo.o: {foo.c} foo.c\n");
     179
    191180
    192181# Test #7: Test stem from the middle of the name.
    193182#
    194 run_make_test('
     183run_make_test(q!
    195184.SECONDEXPANSION:
    196185foobarbaz:
    197186
    198187foo%baz: % $$*.1
    199         @echo $*
     188        @echo '$*'
    200189
    201190bar bar.1:
    202         @echo $@
    203 
    204 ',
    205 '',
    206 'bar
    207 bar.1
    208 bar
    209 ');
     191        @echo '$@'
     192!,
     193              '', "bar\nbar.1\nbar\n");
     194
    210195
    211196# Test #8: Make sure stem triple-expansion does not happen.
    212197#
    213 run_make_test('
     198run_make_test(q!
    214199.SECONDEXPANSION:
    215200foo$$bar:
    216201
    217202f%r: % $$*.1
    218         @echo \'$*\'
     203        @echo '$*'
    219204
    220205oo$$ba oo$$ba.1:
    221         @echo \'$@\'
    222 
    223 ',
    224 '',
    225 'oo$ba
     206        @echo '$@'
     207!,
     208              '', 'oo$ba
    226209oo$ba.1
    227210oo$ba
    228211');
    229212
     213# Test #9: Check the value of $^
     214run_make_test(q!
     215.SECONDEXPANSION:
     216
     217%.so: | $$(extra) ; @echo $^
     218
     219foo.so: extra := foo.o
     220foo.so:
     221foo.o:
     222!,
     223              '', "\n");
    230224
    231225# This tells the test driver that the perl test script executed properly.
  • trunk/src/kmk/tests/scripts/features/se_statpat

    • Property svn:keywords deleted
    r1983 r2591  
    66# Test #1: automatic variables.
    77#
    8 run_make_test('
     8# bird: Had to add -j1 here earlier...
     9run_make_test(q!
    910.SECONDEXPANSION:
    10 .DEFAULT: ; @echo $@
     11.DEFAULT: ; @echo '$@'
    1112
    1213foo.a foo.b: foo.%: bar.% baz.%
    13 
    1414foo.a foo.b: foo.%: biz.% | buz.%
    1515
     
    2020                    $$|.5 \
    2121                    $$*.6
    22 
    23 ',
    24 '-j1',
    25 'bar.a
     22!,
     23              '', 'bar.a
    2624baz.a
    2725biz.a
     
    4240# Test #2: target/pattern -specific variables.
    4341#
    44 run_make_test('
     42run_make_test(q!
    4543.SECONDEXPANSION:
    46 .DEFAULT: ; @echo $@
     44.DEFAULT: ; @echo '$@'
    4745
    4846foo.x foo.y: foo.%: $$(%_a) $$($$*_b)
     
    5149
    5250%.x: x_b := baz
    53 
    54 
    55 ',
    56 '',
    57 'bar
    58 baz
    59 ');
     51!,
     52              '', "bar\nbaz\n");
    6053
    6154
    6255# Test #3: order of prerequisites.
    6356#
    64 run_make_test('
     57# bird: Had to add -j1 here earlier...
     58run_make_test(q!
    6559.SECONDEXPANSION:
    66 .DEFAULT: ; @echo $@
     60.DEFAULT: ; @echo '$@'
    6761
    6862all: foo.a bar.a baz.a
    6963
    7064# Subtest #1
    71 #
    7265foo.a foo.b: foo.%: foo.%.1; @:
    73 
    7466foo.a foo.b: foo.%: foo.%.2
    75 
    7667foo.a foo.b: foo.%: foo.%.3
    7768
    7869
    7970# Subtest #2
    80 #
    8171bar.a bar.b: bar.%: bar.%.2
    82 
    8372bar.a bar.b: bar.%: bar.%.1; @:
    84 
    8573bar.a bar.b: bar.%: bar.%.3
    8674
    8775
    8876# Subtest #3
    89 #
    9077baz.a baz.b: baz.%: baz.%.1
    91 
    9278baz.a baz.b: baz.%: baz.%.2
    93 
    9479baz.a baz.b: ; @:
    95 
    96 ',
    97 '-j1',
    98 'foo.a.1
     80!,
     81             '', 'foo.a.1
    9982foo.a.2
    10083foo.a.3
     
    10992# Test #4: Make sure stem triple-expansion does not happen.
    11093#
    111 run_make_test('
     94run_make_test(q!
    11295.SECONDEXPANSION:
    11396foo$$bar: f%r: % $$*.1
    114         @echo \'$*\'
     97        @echo '$*'
    11598
    11699oo$$ba oo$$ba.1:
    117         @echo \'$@\'
    118 
    119 ',
    120 '',
    121 'oo$ba
     100        @echo '$@'
     101!,
     102              '', 'oo$ba
    122103oo$ba.1
    123104oo$ba
  • trunk/src/kmk/tests/scripts/features/targetvars

    r2165 r2591  
    77rules, semicolon interference, etc.";
    88
    9 open(MAKEFILE,"> $makefile");
    10 
    11 print MAKEFILE <<'EOF';
     9run_make_test('
    1210SHELL = /bin/sh
    1311export FOO = foo
     
    1816three: ; BAR=1000
    1917        @echo $(FOO) $(BAR)
    20 # Some things that shouldn't be target vars
     18# Some things that shouldn not be target vars
    2119funk : override
    2220funk : override adelic
     
    2523four:FOO=x
    2624four:VAR$(FOO)=ok
    27 four: ; @echo '$(FOO) $(VAR$(FOO)) $(VAR) $(VARx)'
     25four: ; @echo "$(FOO) $(VAR$(FOO)) $(VAR) $(VARx)"
    2826five:FOO=x
    2927five six : VAR$(FOO)=good
    30 five six: ;@echo '$(FOO) $(VAR$(FOO)) $(VAR) $(VARx) $(VARfoo)'
     28five six: ;@echo "$(FOO) $(VAR$(FOO)) $(VAR) $(VARx) $(VARfoo)"
    3129# Test per-target variable inheritance
    3230seven: eight
     
    4240# Test = escaping
    4341EQ = =
    44 ten: one\=two
    45 ten: one \= two
     42ten: one$(EQ)two
     43ten: one $(EQ) two
    4644ten one$(EQ)two $(EQ):;@echo $@
    4745.PHONY: one two three four five six seven eight nine ten $(EQ) one$(EQ)two
     
    5553foo.r : RVAR += rvar
    5654foo.t : TVAR := $(QVAR)
    57 EOF
    58 
    59 close(MAKEFILE);
    60 
    61 # TEST #1
    62 
    63 &run_make_with_options($makefile, "-j1 one two three", &get_logfile);
    64 $answer = "one bar\nfoo two\nBAR=1000\nfoo bar\n";
    65 &compare_output($answer,&get_logfile(1));
     55',
     56                 "one two three", "one bar\nfoo two\nBAR=1000\nfoo bar\n");
    6657
    6758# TEST #2
    6859
    69 &run_make_with_options($makefile, "-j1 one two FOO=1 BAR=2", &get_logfile);
    70 $answer = "one 2\n1 2\n";
    71 &compare_output($answer,&get_logfile(1));
     60run_make_test(undef, "one two FOO=1 BAR=2", "one 2\n1 2\n");
    7261
    7362# TEST #3
    7463
    75 &run_make_with_options($makefile, "-j1 four", &get_logfile);
    76 $answer = "x ok  ok\n";
    77 &compare_output($answer,&get_logfile(1));
     64run_make_test(undef, "four", "x ok  ok\n");
    7865
    7966# TEST #4
    8067
    81 &run_make_with_options($makefile, "-j1 seven", &get_logfile);
    82 $answer = "eight: seven eight\nseven: seven seven\n";
    83 &compare_output($answer,&get_logfile(1));
     68run_make_test(undef, "seven", "eight: seven eight\nseven: seven seven\n");
    8469
    8570# TEST #5
    8671
    87 &run_make_with_options($makefile, "-j1 nine", &get_logfile);
    88 $answer = "wallace bar wallace bar\n";
    89 &compare_output($answer,&get_logfile(1));
     72run_make_test(undef, "nine", "wallace bar wallace bar\n");
    9073
    9174# TEST #5-a
    9275
    93 &run_make_with_options($makefile, "-j1 nine-a", &get_logfile);
    94 $answer = "baz\n";
    95 &compare_output($answer,&get_logfile(1));
     76run_make_test(undef, "nine-a", "baz\n");
    9677
    9778# TEST #6
    9879
    99 &run_make_with_options($makefile, "-j1 ten", &get_logfile);
    100 $answer = "one=two\none bar\n=\nfoo two\nten\n";
    101 &compare_output($answer,&get_logfile(1));
     80run_make_test(undef, "ten", "one=two\none bar\n=\nfoo two\nten\n");
    10281
    10382# TEST #6
    10483
    105 &run_make_with_options($makefile, "-j1 foo.q bar.q", &get_logfile);
    106 $answer = "qvar = rvar\nqvar =\n";
    107 &compare_output($answer,&get_logfile(1));
     84run_make_test(undef, "foo.q bar.q", "qvar = rvar\nqvar =\n");
    10885
    10986# TEST #7
    11087
    111 &run_make_with_options($makefile, "-j1 foo.t bar.s", &get_logfile);
    112 $answer = "qvar = qvar\nqvar =\n";
    113 &compare_output($answer,&get_logfile(1));
     88run_make_test(undef, "foo.t bar.s", "qvar = qvar\nqvar =\n");
    11489
    11590
     
    11792# For PR/1378: Target-specific vars don't inherit correctly
    11893
    119 $makefile2 = &get_tmpfile;
    120 
    121 open(MAKEFILE,"> $makefile2");
    122 print MAKEFILE <<'EOF';
     94run_make_test('
    12395foo: FOO = foo
    12496bar: BAR = bar
     
    12698bar: baz
    12799baz: ; @echo $(FOO) $(BAR)
    128 EOF
    129 close(MAKEFILE);
    130 
    131 &run_make_with_options("$makefile2", "", &get_logfile);
    132 $answer = "foo bar\n";
    133 &compare_output($answer, &get_logfile(1));
     100', "", "foo bar\n");
    134101
    135102# TEST #9
     
    137104# Also PR/1831
    138105
    139 $makefile3 = &get_tmpfile;
    140 
    141 open(MAKEFILE,"> $makefile3");
    142 print MAKEFILE <<'EOF';
     106run_make_test('
    143107.PHONY: all one
    144108all: FOO += baz
     
    150114one: FOO += boz
    151115one: ; @echo $(FOO)
    152 EOF
    153 close(MAKEFILE);
    154 
    155 &run_make_with_options("$makefile3", "", &get_logfile);
    156 $answer = "bar baz biz boz\nbar baz\n";
    157 &compare_output($answer, &get_logfile(1));
     116',
     117              '', "bar baz biz boz\nbar baz\n");
    158118
    159119# Test #10
    160120
    161 &run_make_with_options("$makefile3", "one", &get_logfile);
    162 $answer = "bar biz boz\n";
    163 &compare_output($answer, &get_logfile(1));
     121run_make_test(undef, 'one', "bar biz boz\n");
    164122
    165123# Test #11
    166124# PR/1709: Test semicolons in target-specific variable values
    167125
    168 $makefile4 = &get_tmpfile;
    169 
    170 open(MAKEFILE, "> $makefile4");
    171 print MAKEFILE <<'EOF';
     126run_make_test('
    172127foo : FOO = ; ok
    173 foo : ; @echo '$(FOO)'
    174 EOF
    175 close(MAKEFILE);
    176 
    177 &run_make_with_options("$makefile4", "", &get_logfile);
    178 $answer = "; ok\n";
    179 &compare_output($answer, &get_logfile(1));
     128foo : ; @echo "$(FOO)"
     129',
     130              '', "; ok\n");
    180131
    181132# Test #12
     
    183134# I nailed it this time :-/.
    184135
    185 $makefile5 = &get_tmpfile;
    186 
    187 open(MAKEFILE, "> $makefile5");
    188 print MAKEFILE <<'EOF';
     136run_make_test('
    189137.PHONY: a
    190138
     
    196144a: BLAH := bar
    197145a: COMMAND += snafu $(BLAH)
    198 EOF
    199 close(MAKEFILE);
    200 
    201 &run_make_with_options("$makefile5", "", &get_logfile);
    202 $answer = "bar snafu bar\n";
    203 &compare_output($answer, &get_logfile(1));
     146',
     147              '', "bar snafu bar\n");
    204148
    205149# Test #13
    206150# Test double-colon rules with target-specific variable values
    207151
    208 $makefile6 = &get_tmpfile;
    209 
    210 open(MAKEFILE, "> $makefile6");
    211 print MAKEFILE <<'EOF';
     152run_make_test('
    212153W = bad
    213154X = bad
     
    225166  fo% : Z = pat
    226167endif
    227 
    228 EOF
    229 close(MAKEFILE);
    230 
    231 &run_make_with_options("$makefile6", "foo", &get_logfile);
    232 $answer = "ok ok foo nopat\nok ok foo nopat\n";
    233 &compare_output($answer, &get_logfile(1));
     168',
     169             'foo', "ok ok foo nopat\nok ok foo nopat\n");
    234170
    235171# Test #14
     
    237173# inheritance
    238174
    239 &run_make_with_options("$makefile6", "bar", &get_logfile);
    240 $answer = "ok ok bar nopat\nok ok bar nopat\n";
    241 &compare_output($answer, &get_logfile(1));
     175run_make_test(undef, 'bar', "ok ok bar nopat\nok ok bar nopat\n");
    242176
    243177# Test #15
    244178# Test double-colon rules with pattern-specific variable values
    245179
    246 &run_make_with_options("$makefile6", "foo PATTERN=yes", &get_logfile);
    247 $answer = "ok ok foo pat\nok ok foo pat\n";
    248 &compare_output($answer, &get_logfile(1));
    249 
     180run_make_test(undef, 'foo PATTERN=yes', "ok ok foo pat\nok ok foo pat\n");
    250181
    251182# Test #16
     
    253184# (> make default buffer length)
    254185
    255 $makefile7 = &get_tmpfile;
    256 
    257 open(MAKEFILE, "> $makefile7");
    258 print MAKEFILE <<'EOF';
     186run_make_test('
    259187base_metals_fmd_reports.sun5 base_metals_fmd_reports CreateRealPositions        CreateMarginFunds deals_changed_since : BUILD_OBJ=$(shell if [ -f               "build_information.generate" ]; then echo "$(OBJ_DIR)/build_information.o"; else echo "no build information"; fi  )
    260188
    261189deals_changed_since: ; @echo $(BUILD_OBJ)
    262 
    263 EOF
    264 close(MAKEFILE);
    265 
    266 &run_make_with_options("$makefile7", '', &get_logfile);
    267 $answer = "no build information\n";
    268 &compare_output($answer, &get_logfile(1));
     190',
     191              '', "no build information\n");
    269192
    270193# TEST #17
     
    287210.INTERMEDIATE: foo.x rules.mk
    288211',
    289               '-I t1',
    290               'MYVAR= FOOVAR=bar ALLVAR=xxx');
     212              '-I t1', 'MYVAR= FOOVAR=bar ALLVAR=xxx');
    291213
    292214rmfiles('t1/rules.mk');
     
    298220# double-expansion.  See Savannah bug #15913.
    299221
    300 run_make_test("
    301 VAR := \$\$FOO
     222run_make_test('
     223VAR := $$FOO
    302224foo: VAR += BAR
    303 foo: ; \@echo '\$(VAR)'",
    304               '',
    305               '$FOO BAR');
     225foo: ; @echo '."'".'$(VAR)'."'".'
     226',
     227              '', '$FOO BAR');
     228
     229# TEST #19: Override with append variables
     230
     231run_make_test('
     232a: override FOO += f1
     233a: FOO += f2
     234a: ; @echo "$(FOO)"
     235',
     236              '', "f1\n");
     237
     238run_make_test(undef, 'FOO=C', "C f1\n");
     239
     240# TEST #20: Check for continuation after semicolons
     241
     242run_make_test(q!
     243a: A = 'hello; \
     244world'
     245a: ; @echo $(A)
     246!,
     247              '', "hello; world\n");
     248
     249# TEST #19: Test define/endef variables as target-specific vars
     250
     251# run_make_test('
     252# define b
     253# @echo global
     254# endef
     255# a: define b
     256# @echo local
     257# endef
     258
     259# a: ; $(b)
     260# ',
     261#               '', "local\n");
    306262
    3072631;
  • trunk/src/kmk/tests/scripts/features/vpath

    r2162 r2591  
     1#                                                                     -*-perl-*-
     2
    13$description = "The following test creates a makefile to test the \n"
    24              ."vpath directive which allows you to specify a search \n"
     
    6163}
    6264
     65# TEST 2: after vpath lookup ensure we don't get incorrect circular dependency
     66# warnings due to change of struct file ptr.  Savannah bug #13529.
     67
     68mkdir('vpath-d', 0777);
     69
     70run_make_test(q!
     71vpath %.te vpath-d/
     72.SECONDARY:
     73default: vpath-d/a vpath-d/b
     74vpath-d/a: fail.te
     75vpath-d/b : fail.te
     76vpath-d/fail.te:
     77!,
     78              '', "#MAKE#: Nothing to be done for `default'.\n");
     79
     80rmdir('vpath-d');
     81
    63821;
Note: See TracChangeset for help on using the changeset viewer.