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/functions/word

    r284 r501  
    4747# Test error conditions
    4848
    49 $makefile2 = &get_tmpfile;
    50 
    51 open(MAKEFILE, "> $makefile2");
    52 print MAKEFILE <<'EOF';
    53 FOO = foo bar biz baz
     49run_make_test('FOO = foo bar biz baz
    5450
    5551word-e1: ; @echo $(word ,$(FOO))
     
    5955wordlist-e1: ; @echo $(wordlist ,,$(FOO))
    6056wordlist-e2: ; @echo $(wordlist abc ,,$(FOO))
    61 wordlist-e3: ; @echo $(wordlist 1, 12a ,$(FOO))
     57wordlist-e3: ; @echo $(wordlist 1, 12a ,$(FOO))',
     58              'word-e1',
     59              "#MAKEFILE#:3: *** non-numeric first argument to `word' function: ''.  Stop.",
     60              512);
    6261
    63 EOF
     62run_make_test(undef,
     63              'word-e2',
     64              "#MAKEFILE#:4: *** non-numeric first argument to `word' function: 'abc '.  Stop.",
     65              512);
    6466
    65 close(MAKEFILE);
     67run_make_test(undef,
     68              'word-e3',
     69              "#MAKEFILE#:5: *** non-numeric first argument to `word' function: '1a'.  Stop.",
     70              512);
    6671
    67 &run_make_with_options($makefile2, 'word-e1', &get_logfile, 512);
    68 $answer = "$makefile2:3: *** non-numeric first argument to `word' function: ''.  Stop.\n";
    69 &compare_output($answer, &get_logfile(1));
     72run_make_test(undef,
     73              'wordlist-e1',
     74              "#MAKEFILE#:7: *** non-numeric first argument to `wordlist' function: ''.  Stop.",
     75              512);
    7076
    71 &run_make_with_options($makefile2, 'word-e2', &get_logfile, 512);
    72 $answer = "$makefile2:4: *** non-numeric first argument to `word' function: 'abc '.  Stop.\n";
    73 &compare_output($answer, &get_logfile(1));
     77run_make_test(undef,
     78              'wordlist-e2',
     79              "#MAKEFILE#:8: *** non-numeric first argument to `wordlist' function: 'abc '.  Stop.",
     80              512);
    7481
    75 &run_make_with_options($makefile2, 'word-e3', &get_logfile, 512);
    76 $answer = "$makefile2:5: *** non-numeric first argument to `word' function: '1a'.  Stop.\n";
    77 &compare_output($answer, &get_logfile(1));
     82run_make_test(undef,
     83              'wordlist-e3',
     84              "#MAKEFILE#:9: *** non-numeric second argument to `wordlist' function: ' 12a '.  Stop.",
     85              512);
    7886
    79 &run_make_with_options($makefile2, 'wordlist-e1', &get_logfile, 512);
    80 $answer = "$makefile2:7: *** non-numeric first argument to `wordlist' function: ''.  Stop.\n";
    81 &compare_output($answer, &get_logfile(1));
     87# Test error conditions again, but this time in a variable reference
    8288
    83 &run_make_with_options($makefile2, 'wordlist-e2', &get_logfile, 512);
    84 $answer = "$makefile2:8: *** non-numeric first argument to `wordlist' function: 'abc '.  Stop.\n";
    85 &compare_output($answer, &get_logfile(1));
     89run_make_test('FOO = foo bar biz baz
    8690
    87 &run_make_with_options($makefile2, 'wordlist-e3', &get_logfile, 512);
    88 $answer = "$makefile2:9: *** non-numeric second argument to `wordlist' function: ' 12a '.  Stop.\n";
    89 &compare_output($answer, &get_logfile(1));
     91W = $(word $x,$(FOO))
     92WL = $(wordlist $s,$e,$(FOO))
     93
     94word-e: ; @echo $(W)
     95wordlist-e: ; @echo $(WL)',
     96              'word-e x=',
     97              "#MAKEFILE#:3: *** non-numeric first argument to `word' function: ''.  Stop.",
     98              512);
     99
     100run_make_test(undef,
     101              'word-e x=abc',
     102              "#MAKEFILE#:3: *** non-numeric first argument to `word' function: 'abc'.  Stop.",
     103              512);
     104
     105run_make_test(undef,
     106              'word-e x=0',
     107              "#MAKEFILE#:3: *** first argument to `word' function must be greater than 0.  Stop.",
     108              512);
     109
     110run_make_test(undef,
     111              'wordlist-e s= e=',
     112              "#MAKEFILE#:4: *** non-numeric first argument to `wordlist' function: ''.  Stop.",
     113              512);
     114
     115run_make_test(undef,
     116              'wordlist-e s=abc e=',
     117              "#MAKEFILE#:4: *** non-numeric first argument to `wordlist' function: 'abc'.  Stop.",
     118              512);
     119
     120run_make_test(undef,
     121              'wordlist-e s=4 e=12a',
     122              "#MAKEFILE#:4: *** non-numeric second argument to `wordlist' function: '12a'.  Stop.",
     123              512);
     124
     125run_make_test(undef,
     126              'wordlist-e s=0 e=12',
     127              "#MAKEFILE#:4: *** invalid first argument to `wordlist' function: `0'.  Stop.",
     128              512);
    90129
    91130
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