提交 f983a2bc 编写于 作者: S Satoru Takeuchi 提交者: Steven Rostedt

ktest: add 2nd parameter of run_command() to set the redirect target file

If we'd like to set the redirect target file of run_command(),
we should define $redirect before calling this function and should undef it
after calling this function. Since it's user-unfriendly, add 2nd parameter of
run_command() for this purpose.

Link: http://lkml.kernel.org/r/87vbvwokq8.wl%satoru.takeuchi@gmail.comSigned-off-by: NSatoru Takeuchi <satoru.takeuchi@gmail.com>
Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
上级 a798c10f
...@@ -149,7 +149,6 @@ my $bisect_ret_abort; ...@@ -149,7 +149,6 @@ my $bisect_ret_abort;
my $bisect_ret_default; my $bisect_ret_default;
my $in_patchcheck = 0; my $in_patchcheck = 0;
my $run_test; my $run_test;
my $redirect;
my $buildlog; my $buildlog;
my $testlog; my $testlog;
my $dmesg; my $dmesg;
...@@ -1529,7 +1528,7 @@ sub fail { ...@@ -1529,7 +1528,7 @@ sub fail {
} }
sub run_command { sub run_command {
my ($command) = @_; my ($command, $redirect) = @_;
my $dolog = 0; my $dolog = 0;
my $dord = 0; my $dord = 0;
my $pid; my $pid;
...@@ -2265,9 +2264,7 @@ sub build { ...@@ -2265,9 +2264,7 @@ sub build {
# Run old config regardless, to enforce min configurations # Run old config regardless, to enforce min configurations
make_oldconfig; make_oldconfig;
$redirect = "$buildlog"; my $build_ret = run_command "$make $build_options", $buildlog;
my $build_ret = run_command "$make $build_options";
undef $redirect;
if (defined($post_build)) { if (defined($post_build)) {
# Because a post build may change the kernel version # Because a post build may change the kernel version
...@@ -2360,9 +2357,7 @@ sub child_run_test { ...@@ -2360,9 +2357,7 @@ sub child_run_test {
$poweroff_on_error = 0; $poweroff_on_error = 0;
$die_on_failure = 1; $die_on_failure = 1;
$redirect = "$testlog"; run_command $run_test, $testlog or $failed = 1;
run_command $run_test or $failed = 1;
undef $redirect;
exit $failed; exit $failed;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册