From 416664b1e79c0ca4ad463ad3a1bd17a6f00e7992 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Mon, 18 Apr 2022 16:57:06 -0400 Subject: [PATCH] * tests/scripts/features/errors: Fix Perl warnings * tests/scripts/options/dash-f: Ditto. --- tests/scripts/features/errors | 4 +--- tests/scripts/options/dash-f | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/tests/scripts/features/errors b/tests/scripts/features/errors index 708123c9..f395032c 100644 --- a/tests/scripts/features/errors +++ b/tests/scripts/features/errors @@ -50,9 +50,7 @@ sub errors_getinfo my $unk = './foobarbazbozblat'; unlink($unk); -my $ernum, $erstr; - -($ernum, $erstr) = errors_getinfo($unk, "xx yy"); +my ($ernum, $erstr) = errors_getinfo($unk, "xx yy"); run_make_test(qq! one: ; -$unk xx yy !, 'one', diff --git a/tests/scripts/options/dash-f b/tests/scripts/options/dash-f index 6cbd54f8..b3c78ad6 100644 --- a/tests/scripts/options/dash-f +++ b/tests/scripts/options/dash-f @@ -110,13 +110,16 @@ touch bye.mk #MAKE#: *** No rule to make target 'R'. Stop. ", 512); +my @opts; +my $answer; + # Test double -f-. -my @opts = ('-f- -f-', '-f - -f -', '-f- -f -', '-f - -f-', - '-f- --file=-', '-f- --file -', '-f - --file=-', '-f - --file -', - '-f- --makefile=-', '-f- --makefile -', - '-f - --makefile=-', '-f - --makefile -', - '--file=- --makefile=-', '--file=- --makefile -', - '--file - --makefile=-', '--file - --makefile -'); +@opts = ('-f- -f-', '-f - -f -', '-f- -f -', '-f - -f-', + '-f- --file=-', '-f- --file -', '-f - --file=-', '-f - --file -', + '-f- --makefile=-', '-f- --makefile -', + '-f - --makefile=-', '-f - --makefile -', + '--file=- --makefile=-', '--file=- --makefile -', + '--file - --makefile=-', '--file - --makefile -'); for my $opt (@opts) { # 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. -my @opts = ('-f', '--file', '--makefile'); -my $answer = "/requires an argument/"; +@opts = ('-f', '--file', '--makefile'); +$answer = "/requires an argument/"; for my $opt (@opts) { 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 # the standard input. -my $answer = "touch bye.mk.src +$answer = "touch bye.mk.src touch bye.mk hello, world #MAKE#: 'all' is up to date.\n"; -my @opts = ('-f- all', '-f - all', '-Rf- all', '-Rf - all', - '--file=- all', '--file - all', - '--makefile=- all', '--makefile - all'); +@opts = ('-f- all', '-f - all', '-Rf- all', '-Rf - all', + '--file=- all', '--file - all', + '--makefile=- all', '--makefile - all'); for my $opt (@opts) { unlink($byesrc); close(STDIN);