diff options
author | Satoru Takeuchi <satoru.takeuchi@gmail.com> | 2014-03-02 07:20:31 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2014-04-23 23:18:09 -0400 |
commit | f983a2bc9d355fb04932b38fee2533114c204cce (patch) | |
tree | 78625c19f7d442df9fa66eb3c57a64a202811b6a /tools/testing/ktest | |
parent | a798c10faf62a505d24e5f6213fbaf904a39623f (diff) |
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.com
Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing/ktest')
-rwxr-xr-x | tools/testing/ktest/ktest.pl | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 40631569a0fd..f731ef69aed2 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl | |||
@@ -149,7 +149,6 @@ my $bisect_ret_abort; | |||
149 | my $bisect_ret_default; | 149 | my $bisect_ret_default; |
150 | my $in_patchcheck = 0; | 150 | my $in_patchcheck = 0; |
151 | my $run_test; | 151 | my $run_test; |
152 | my $redirect; | ||
153 | my $buildlog; | 152 | my $buildlog; |
154 | my $testlog; | 153 | my $testlog; |
155 | my $dmesg; | 154 | my $dmesg; |
@@ -1529,7 +1528,7 @@ sub fail { | |||
1529 | } | 1528 | } |
1530 | 1529 | ||
1531 | sub run_command { | 1530 | sub run_command { |
1532 | my ($command) = @_; | 1531 | my ($command, $redirect) = @_; |
1533 | my $dolog = 0; | 1532 | my $dolog = 0; |
1534 | my $dord = 0; | 1533 | my $dord = 0; |
1535 | my $pid; | 1534 | my $pid; |
@@ -2265,9 +2264,7 @@ sub build { | |||
2265 | # Run old config regardless, to enforce min configurations | 2264 | # Run old config regardless, to enforce min configurations |
2266 | make_oldconfig; | 2265 | make_oldconfig; |
2267 | 2266 | ||
2268 | $redirect = "$buildlog"; | 2267 | my $build_ret = run_command "$make $build_options", $buildlog; |
2269 | my $build_ret = run_command "$make $build_options"; | ||
2270 | undef $redirect; | ||
2271 | 2268 | ||
2272 | if (defined($post_build)) { | 2269 | if (defined($post_build)) { |
2273 | # Because a post build may change the kernel version | 2270 | # Because a post build may change the kernel version |
@@ -2360,9 +2357,7 @@ sub child_run_test { | |||
2360 | $poweroff_on_error = 0; | 2357 | $poweroff_on_error = 0; |
2361 | $die_on_failure = 1; | 2358 | $die_on_failure = 1; |
2362 | 2359 | ||
2363 | $redirect = "$testlog"; | 2360 | run_command $run_test, $testlog or $failed = 1; |
2364 | run_command $run_test or $failed = 1; | ||
2365 | undef $redirect; | ||
2366 | 2361 | ||
2367 | exit $failed; | 2362 | exit $failed; |
2368 | } | 2363 | } |