public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] support: Invent verbose_printf macro
Date: Fri, 21 Jun 2019 13:35:00 -0000	[thread overview]
Message-ID: <20190621133501.96879.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8bf225d5832eda8fefce9361c53cb68a55150b96

commit 8bf225d5832eda8fefce9361c53cb68a55150b96
Author: Mike Crowe <mac@mcrowe.com>
Date:   Wed Jun 19 18:06:14 2019 -0300

    support: Invent verbose_printf macro
    
    Make it easier for tests to emit progress messages only when --verbose is
    specified.
    
    * support/test-driver.h: Add verbose_printf macro.

Diff:
---
 ChangeLog             | 2 ++
 support/test-driver.h | 8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index de58169..a67ffe7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2019-06-20  Mike Crowe  <mac@mcrowe.com>
 
+	* support/test-driver.h: Add verbose_printf macro.
+
 	* support/xtime.h: Add xclock_now() helper function.
 
 2019-06-20  Dmitry V. Levin  <ldv@altlinux.org>
diff --git a/support/test-driver.h b/support/test-driver.h
index a9710af..55f355f 100644
--- a/support/test-driver.h
+++ b/support/test-driver.h
@@ -69,6 +69,14 @@ extern const char *test_dir;
    tests.  */
 extern unsigned int test_verbose;
 
+/* Output that is only emitted if at least one --verbose argument was
+   specified. */
+#define verbose_printf(...)                      \
+  do {                                           \
+    if (test_verbose > 0)                        \
+      printf (__VA_ARGS__);                      \
+  } while (0);
+
 int support_test_main (int argc, char **argv, const struct test_config *);
 
 __END_DECLS


                 reply	other threads:[~2019-06-21 13:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190621133501.96879.qmail@sourceware.org \
    --to=azanella@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).