Commit 2b0be382 authored by Bjorn Munch's avatar Bjorn Munch

Bug #48806 mysql-test-run.pl --help should work even in the absence of binaries

Searches for my_safe_process binary too early
Put this into a sub() and call it after examining options (incl. --help)
parent f57dda3b
...@@ -81,10 +81,13 @@ sub is_child { ...@@ -81,10 +81,13 @@ sub is_child {
} }
# Find the safe process binary or script
my @safe_process_cmd; my @safe_process_cmd;
my $safe_kill; my $safe_kill;
if (IS_WIN32PERL or IS_CYGWIN){
# Find the safe process binary or script
sub find_bin {
if (IS_WIN32PERL or IS_CYGWIN)
{
# Use my_safe_process.exe # Use my_safe_process.exe
my $exe= my_find_bin(".", ["lib/My/SafeProcess", "My/SafeProcess"], my $exe= my_find_bin(".", ["lib/My/SafeProcess", "My/SafeProcess"],
"my_safe_process"); "my_safe_process");
...@@ -92,13 +95,14 @@ if (IS_WIN32PERL or IS_CYGWIN){ ...@@ -92,13 +95,14 @@ if (IS_WIN32PERL or IS_CYGWIN){
# Use my_safe_kill.exe # Use my_safe_kill.exe
$safe_kill= my_find_bin(".", "lib/My/SafeProcess", "my_safe_kill"); $safe_kill= my_find_bin(".", "lib/My/SafeProcess", "my_safe_kill");
} }
else else
{ {
# Use my_safe_process # Use my_safe_process
my $exe= my_find_bin(".", ["lib/My/SafeProcess", "My/SafeProcess"], my $exe= my_find_bin(".", ["lib/My/SafeProcess", "My/SafeProcess"],
"my_safe_process"); "my_safe_process");
push(@safe_process_cmd, $exe); push(@safe_process_cmd, $exe);
}
} }
......
...@@ -266,6 +266,9 @@ sub main { ...@@ -266,6 +266,9 @@ sub main {
command_line_setup(); command_line_setup();
# --help will not reach here, so now it's safe to assume we have binaries
My::SafeProcess::find_bin();
if ( $opt_gcov ) { if ( $opt_gcov ) {
gcov_prepare($basedir); gcov_prepare($basedir);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment