summaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-11-08 22:39:57 +0100
committerSteven Rostedt <rostedt@goodmis.org>2010-11-18 17:23:10 +0100
commitd1e2f22ad718c83ab19297e7717679c5ed17c020 (patch)
treeda71ebe95dfd8ec61e8a1359ae3f1971472ad2f8 /tools/testing
parentktest: Use oldnoconfig instead of yes command (diff)
downloadlinux-d1e2f22ad718c83ab19297e7717679c5ed17c020.tar.xz
linux-d1e2f22ad718c83ab19297e7717679c5ed17c020.zip
ktest: Write to stdout if no log file is given
If no LOG_FILE option is set, then write what would be logged to that file to standard output. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing')
-rwxr-xr-x[-rw-r--r--]tools/testing/ktest/ktest.pl12
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 5bd00755727c..0a5ed0db4ff3 100644..100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -230,7 +230,7 @@ sub read_config {
}
}
-sub logit {
+sub _logit {
if (defined($opt{"LOG_FILE"})) {
open(OUT, ">> $opt{LOG_FILE}") or die "Can't write to $opt{LOG_FILE}";
print OUT @_;
@@ -238,9 +238,17 @@ sub logit {
}
}
+sub logit {
+ if (defined($opt{"LOG_FILE"})) {
+ _logit @_;
+ } else {
+ print @_;
+ }
+}
+
sub doprint {
print @_;
- logit @_;
+ _logit @_;
}
sub run_command;