Changeset 501 in kBuild for vendor/gnumake/current/tests/scripts/functions/word
- Timestamp:
- Sep 15, 2006 2:30:32 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current/tests/scripts/functions/word
r284 r501 47 47 # Test error conditions 48 48 49 $makefile2 = &get_tmpfile; 50 51 open(MAKEFILE, "> $makefile2"); 52 print MAKEFILE <<'EOF'; 53 FOO = foo bar biz baz 49 run_make_test('FOO = foo bar biz baz 54 50 55 51 word-e1: ; @echo $(word ,$(FOO)) … … 59 55 wordlist-e1: ; @echo $(wordlist ,,$(FOO)) 60 56 wordlist-e2: ; @echo $(wordlist abc ,,$(FOO)) 61 wordlist-e3: ; @echo $(wordlist 1, 12a ,$(FOO)) 57 wordlist-e3: ; @echo $(wordlist 1, 12a ,$(FOO))', 58 'word-e1', 59 "#MAKEFILE#:3: *** non-numeric first argument to `word' function: ''. Stop.", 60 512); 62 61 63 EOF 62 run_make_test(undef, 63 'word-e2', 64 "#MAKEFILE#:4: *** non-numeric first argument to `word' function: 'abc '. Stop.", 65 512); 64 66 65 close(MAKEFILE); 67 run_make_test(undef, 68 'word-e3', 69 "#MAKEFILE#:5: *** non-numeric first argument to `word' function: '1a'. Stop.", 70 512); 66 71 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)); 72 run_make_test(undef, 73 'wordlist-e1', 74 "#MAKEFILE#:7: *** non-numeric first argument to `wordlist' function: ''. Stop.", 75 512); 70 76 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)); 77 run_make_test(undef, 78 'wordlist-e2', 79 "#MAKEFILE#:8: *** non-numeric first argument to `wordlist' function: 'abc '. Stop.", 80 512); 74 81 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)); 82 run_make_test(undef, 83 'wordlist-e3', 84 "#MAKEFILE#:9: *** non-numeric second argument to `wordlist' function: ' 12a '. Stop.", 85 512); 78 86 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 82 88 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)); 89 run_make_test('FOO = foo bar biz baz 86 90 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)); 91 W = $(word $x,$(FOO)) 92 WL = $(wordlist $s,$e,$(FOO)) 93 94 word-e: ; @echo $(W) 95 wordlist-e: ; @echo $(WL)', 96 'word-e x=', 97 "#MAKEFILE#:3: *** non-numeric first argument to `word' function: ''. Stop.", 98 512); 99 100 run_make_test(undef, 101 'word-e x=abc', 102 "#MAKEFILE#:3: *** non-numeric first argument to `word' function: 'abc'. Stop.", 103 512); 104 105 run_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 110 run_make_test(undef, 111 'wordlist-e s= e=', 112 "#MAKEFILE#:4: *** non-numeric first argument to `wordlist' function: ''. Stop.", 113 512); 114 115 run_make_test(undef, 116 'wordlist-e s=abc e=', 117 "#MAKEFILE#:4: *** non-numeric first argument to `wordlist' function: 'abc'. Stop.", 118 512); 119 120 run_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 125 run_make_test(undef, 126 'wordlist-e s=0 e=12', 127 "#MAKEFILE#:4: *** invalid first argument to `wordlist' function: `0'. Stop.", 128 512); 90 129 91 130
Note:
See TracChangeset
for help on using the changeset viewer.

