* tests/scripts/features/errors: Fix Perl warnings

* tests/scripts/options/dash-f: Ditto.
This commit is contained in:
Paul Smith 2022-04-18 16:57:06 -04:00
parent 667d70eac2
commit 416664b1e7
2 changed files with 16 additions and 15 deletions

View file

@ -50,9 +50,7 @@ sub errors_getinfo
my $unk = './foobarbazbozblat'; my $unk = './foobarbazbozblat';
unlink($unk); unlink($unk);
my $ernum, $erstr; my ($ernum, $erstr) = errors_getinfo($unk, "xx yy");
($ernum, $erstr) = errors_getinfo($unk, "xx yy");
run_make_test(qq! run_make_test(qq!
one: ; -$unk xx yy one: ; -$unk xx yy
!, 'one', !, 'one',

View file

@ -110,13 +110,16 @@ touch bye.mk
#MAKE#: *** No rule to make target 'R'. Stop. #MAKE#: *** No rule to make target 'R'. Stop.
", 512); ", 512);
my @opts;
my $answer;
# Test double -f-. # Test double -f-.
my @opts = ('-f- -f-', '-f - -f -', '-f- -f -', '-f - -f-', @opts = ('-f- -f-', '-f - -f -', '-f- -f -', '-f - -f-',
'-f- --file=-', '-f- --file -', '-f - --file=-', '-f - --file -', '-f- --file=-', '-f- --file -', '-f - --file=-', '-f - --file -',
'-f- --makefile=-', '-f- --makefile -', '-f- --makefile=-', '-f- --makefile -',
'-f - --makefile=-', '-f - --makefile -', '-f - --makefile=-', '-f - --makefile -',
'--file=- --makefile=-', '--file=- --makefile -', '--file=- --makefile=-', '--file=- --makefile -',
'--file - --makefile=-', '--file - --makefile -'); '--file - --makefile=-', '--file - --makefile -');
for my $opt (@opts) { for my $opt (@opts) {
# We shouldn't need this; if the options are wrong then make shouldn't try # We shouldn't need this; if the options are wrong then make shouldn't try
@ -127,8 +130,8 @@ for my $opt (@opts) {
} }
# -f is not followed by filename. # -f is not followed by filename.
my @opts = ('-f', '--file', '--makefile'); @opts = ('-f', '--file', '--makefile');
my $answer = "/requires an argument/"; $answer = "/requires an argument/";
for my $opt (@opts) { for my $opt (@opts) {
run_make_test('', $opt, $answer, 512); run_make_test('', $opt, $answer, 512);
} }
@ -136,14 +139,14 @@ for my $opt (@opts) {
# Test that make correctly parses all possible syntaxes to pipe make code to # Test that make correctly parses all possible syntaxes to pipe make code to
# the standard input. # the standard input.
my $answer = "touch bye.mk.src $answer = "touch bye.mk.src
touch bye.mk touch bye.mk
hello, world hello, world
#MAKE#: 'all' is up to date.\n"; #MAKE#: 'all' is up to date.\n";
my @opts = ('-f- all', '-f - all', '-Rf- all', '-Rf - all', @opts = ('-f- all', '-f - all', '-Rf- all', '-Rf - all',
'--file=- all', '--file - all', '--file=- all', '--file - all',
'--makefile=- all', '--makefile - all'); '--makefile=- all', '--makefile - all');
for my $opt (@opts) { for my $opt (@opts) {
unlink($byesrc); unlink($byesrc);
close(STDIN); close(STDIN);