From: Thomas Huth Subject: Re: [kvm-unit-tests PATCH v2 2/2] report: introduce report_info Date: Tue, 22 Nov 2016 15:50:03 +0100 Message-ID: <2280decc-7559-951d-c87e-12b79f4ef0c7@redhat.com> References: <1479824506-19690-1-git-send-email-drjones@redhat.com> <1479824506-19690-3-git-send-email-drjones@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: rkrcmar@redhat.com To: Andrew Jones , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:34174 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933362AbcKVOuF (ORCPT ); Tue, 22 Nov 2016 09:50:05 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4541E61BB0 for ; Tue, 22 Nov 2016 14:50:05 +0000 (UTC) In-Reply-To: <1479824506-19690-3-git-send-email-drjones@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 22.11.2016 15:21, Andrew Jones wrote: > Test writers sometimes want to output informational messages, but > they don't want to use printf because they want the prefixes as > well. Rather than creating "fake" tests that always pass, with > report(fmt, true, ...), provide report_info(fmt, ...). This > generates 'INFO: prefixes...: message' > > Signed-off-by: Andrew Jones > --- > lib/libcflat.h | 1 + > lib/report.c | 14 ++++++++++++++ > 2 files changed, 15 insertions(+) > > diff --git a/lib/libcflat.h b/lib/libcflat.h > index 72b1bf9668ef..c622198677c1 100644 > --- a/lib/libcflat.h > +++ b/lib/libcflat.h > @@ -82,6 +82,7 @@ extern void report(const char *msg_fmt, bool pass, ...); > extern void report_xfail(const char *msg_fmt, bool xfail, bool pass, ...); > extern void report_abort(const char *msg_fmt, ...); > extern void report_skip(const char *msg_fmt, ...); > +extern void report_info(const char *msg_fmt, ...); > extern int report_summary(void); > > extern void dump_stack(void); > diff --git a/lib/report.c b/lib/report.c > index 2a8b6df1368d..fc0ef494f412 100644 > --- a/lib/report.c > +++ b/lib/report.c > @@ -91,6 +91,20 @@ void report_skip(const char *msg_fmt, ...) > va_end(va); > } > > +void report_info(const char *msg_fmt, ...) > +{ > + va_list va; > + > + spin_lock(&lock); > + puts("INFO: "); > + puts(prefixes); > + va_start(va, msg_fmt); > + vprintf(msg_fmt, va); > + va_end(va); > + puts("\n"); > + spin_unlock(&lock); > +} > + > int report_summary(void) > { > spin_lock(&lock); > Reviewed-by: Thomas Huth