public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ktest: add 2nd parameter of run_command() to set the redirect target file
@ 2014-03-09 14:29 Satoru Takeuchi
  2014-03-09 14:32 ` [PATCH 2/3] ktest: Some cleanup for improving readability Satoru Takeuchi
  0 siblings, 1 reply; 7+ messages in thread
From: Satoru Takeuchi @ 2014-03-09 14:29 UTC (permalink / raw)
  To: LKML; +Cc: Steven Rostedt

From: Satoru Takeuchi <satoru.takeuchi@gmail.com>

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

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
---
 tools/testing/ktest/ktest.pl | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 4063156..f731ef6 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -149,7 +149,6 @@ my $bisect_ret_abort;
 my $bisect_ret_default;
 my $in_patchcheck = 0;
 my $run_test;
-my $redirect;
 my $buildlog;
 my $testlog;
 my $dmesg;
@@ -1529,7 +1528,7 @@ sub fail {
 }
 
 sub run_command {
-    my ($command) = @_;
+    my ($command, $redirect) = @_;
     my $dolog = 0;
     my $dord = 0;
     my $pid;
@@ -2265,9 +2264,7 @@ sub build {
     # Run old config regardless, to enforce min configurations
     make_oldconfig;
 
-    $redirect = "$buildlog";
-    my $build_ret = run_command "$make $build_options";
-    undef $redirect;
+    my $build_ret = run_command "$make $build_options", $buildlog;
 
     if (defined($post_build)) {
 	# Because a post build may change the kernel version
@@ -2360,9 +2357,7 @@ sub child_run_test {
     $poweroff_on_error = 0;
     $die_on_failure = 1;
 
-    $redirect = "$testlog";
-    run_command $run_test or $failed = 1;
-    undef $redirect;
+    run_command $run_test, $testlog or $failed = 1;
 
     exit $failed;
 }
-- 
1.9.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-03-11 19:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-09 14:29 [PATCH 1/3] ktest: add 2nd parameter of run_command() to set the redirect target file Satoru Takeuchi
2014-03-09 14:32 ` [PATCH 2/3] ktest: Some cleanup for improving readability Satoru Takeuchi
2014-03-09 14:36   ` [PATCH 3/3] ktest: remove the misleading $buildonly and introduce $laststep Satoru Takeuchi
2014-03-10 16:13     ` Steven Rostedt
2014-03-11 11:43       ` Satoru Takeuchi
2014-03-11 11:50         ` Satoru Takeuchi
2014-03-11 19:56           ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox