зеркало из https://github.com/mozilla/gecko-dev.git
Improving efficiency by calling xp_path() as little as possible. Also, never call xp_path() on a user-provided path.
Improving consistency of style in the get_xxx_engine_command() functions.
This commit is contained in:
Родитель
dfc88a5e36
Коммит
396d6db9e7
|
@ -147,7 +147,7 @@ sub main {
|
||||||
|
|
||||||
sub execute_tests {
|
sub execute_tests {
|
||||||
my (@test_list) = @_;
|
my (@test_list) = @_;
|
||||||
my ($test, $shell_command, $line, @output);
|
my ($test, $shell_command, $line, @output, $path);
|
||||||
my $file_param = " -f ";
|
my $file_param = " -f ";
|
||||||
my ($last_suite, $last_test_dir);
|
my ($last_suite, $last_test_dir);
|
||||||
|
|
||||||
|
@ -173,26 +173,26 @@ sub execute_tests {
|
||||||
if ($last_suite ne $suite || $last_test_dir ne $test_dir) {
|
if ($last_suite ne $suite || $last_test_dir ne $test_dir) {
|
||||||
$shell_command = &xp_path($engine_command);
|
$shell_command = &xp_path($engine_command);
|
||||||
|
|
||||||
if (-f &xp_path($opt_suite_path . $suite . "/shell.js")) {
|
$path = &xp_path($opt_suite_path . $suite . "/shell.js");
|
||||||
$shell_command .= $file_param . &xp_path($opt_suite_path .
|
if (-f $path) {
|
||||||
$suite . "/shell.js");
|
$shell_command .= $file_param . $path;
|
||||||
}
|
}
|
||||||
if (-f &xp_path($opt_suite_path . $suite . "/" . $test_dir .
|
|
||||||
"/shell.js")) {
|
$path = &xp_path($opt_suite_path . $suite . "/" .
|
||||||
$shell_command .= $file_param .
|
$test_dir . "/shell.js");
|
||||||
&xp_path($opt_suite_path . $suite . "/" . $test_dir .
|
if (-f $path) {
|
||||||
"/shell.js");
|
$shell_command .= $file_param . $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
$last_suite = $suite;
|
$last_suite = $suite;
|
||||||
$last_test_dir = $test_dir;
|
$last_test_dir = $test_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
&dd ("executing: " . $shell_command . $file_param .
|
$path = &xp_path($opt_suite_path . $test);
|
||||||
&xp_path($opt_suite_path . $test));
|
&dd ("executing: " . $shell_command . $file_param . $path);
|
||||||
|
|
||||||
open (OUTPUT, $shell_command . $file_param .
|
open (OUTPUT, $shell_command . $file_param . $path .
|
||||||
&xp_path($opt_suite_path . $test) . $redirect_command . " |");
|
$redirect_command . " |");
|
||||||
@output = <OUTPUT>;
|
@output = <OUTPUT>;
|
||||||
close (OUTPUT);
|
close (OUTPUT);
|
||||||
|
|
||||||
|
@ -592,6 +592,7 @@ sub get_rhino_engine_command {
|
||||||
# get the shell command used to run xpcshell
|
# get the shell command used to run xpcshell
|
||||||
#
|
#
|
||||||
sub get_xpc_engine_command {
|
sub get_xpc_engine_command {
|
||||||
|
my $retval;
|
||||||
my $m5_home = @ENV{"MOZILLA_FIVE_HOME"} ||
|
my $m5_home = @ENV{"MOZILLA_FIVE_HOME"} ||
|
||||||
die ("You must set MOZILLA_FIVE_HOME to use the xpcshell" ,
|
die ("You must set MOZILLA_FIVE_HOME to use the xpcshell" ,
|
||||||
(!$unixish) ? "." : ", also " .
|
(!$unixish) ? "." : ", also " .
|
||||||
|
@ -607,7 +608,20 @@ sub get_xpc_engine_command {
|
||||||
$m5_home .= "/";
|
$m5_home .= "/";
|
||||||
}
|
}
|
||||||
|
|
||||||
return &xp_path($m5_home . "xpcshell");
|
$retval = $m5_home . "xpcshell";
|
||||||
|
|
||||||
|
if ($os_type eq "WIN") {
|
||||||
|
$retval .= ".exe";
|
||||||
|
}
|
||||||
|
|
||||||
|
$retval = &xp_path($retval);
|
||||||
|
|
||||||
|
if (($os_type ne "MAC") && !(-x $retval)) {
|
||||||
|
# mac doesn't seem to deal with -x correctly
|
||||||
|
die ($retval . " is not a valid executable on this system.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return $retval;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -682,14 +696,17 @@ sub get_sm_engine_command {
|
||||||
}
|
}
|
||||||
} # mac/ not mac
|
} # mac/ not mac
|
||||||
|
|
||||||
|
$retval = &xp_path($retval);
|
||||||
|
|
||||||
} # (user provided a path)
|
} # (user provided a path)
|
||||||
|
|
||||||
if (($os_type ne "MAC") && !(-x &xp_path($retval))) {
|
|
||||||
|
if (($os_type ne "MAC") && !(-x $retval)) {
|
||||||
# mac doesn't seem to deal with -x correctly
|
# mac doesn't seem to deal with -x correctly
|
||||||
die (&xp_path($retval) . " is not a valid executable on this system.\n");
|
die ($retval . " is not a valid executable on this system.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return &xp_path($retval);
|
return $retval;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -734,19 +751,22 @@ sub get_dd_engine_command {
|
||||||
|
|
||||||
|
|
||||||
if ($opt_engine_type eq "dddebug") {
|
if ($opt_engine_type eq "dddebug") {
|
||||||
$retval = &xp_path($dir . $os . $debug . $exe);
|
$retval = $dir . $os . $debug . $exe;
|
||||||
} else {
|
} else {
|
||||||
$retval = &xp_path($dir . $os . $opt . $exe);
|
$retval = $dir . $os . $opt . $exe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$retval = &xp_path($retval);
|
||||||
|
|
||||||
if (($os_type ne "MAC") && !(-x &xp_path($retval))) {
|
}# (user provided a path)
|
||||||
|
|
||||||
|
|
||||||
|
if (($os_type ne "MAC") && !(-x $retval)) {
|
||||||
# mac doesn't seem to deal with -x correctly
|
# mac doesn't seem to deal with -x correctly
|
||||||
die ($retval . " is not a valid executable on this system.\n");
|
die ($retval . " is not a valid executable on this system.\n");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return &xp_path($retval);
|
return $retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -791,13 +811,18 @@ sub get_lc_engine_command {
|
||||||
$retval .= "lcshell";
|
$retval .= "lcshell";
|
||||||
}
|
}
|
||||||
} # mac/ not mac
|
} # mac/ not mac
|
||||||
}
|
|
||||||
|
|
||||||
if (!(-x &xp_path($retval))) {
|
$retval = &xp_path($retval);
|
||||||
|
|
||||||
|
} # (user provided a path)
|
||||||
|
|
||||||
|
|
||||||
|
if (($os_type ne "MAC") && !(-x $retval)) {
|
||||||
|
# mac doesn't seem to deal with -x correctly
|
||||||
die ("$retval is not a valid executable on this system.\n");
|
die ("$retval is not a valid executable on this system.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return &xp_path($retval);
|
return $retval;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче