From: Mike Crowe Date: Wed, 19 Jun 2019 21:06:14 +0000 (-0300) Subject: support: Invent verbose_printf macro X-Git-Tag: glibc-2.30~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bf225d5832eda8fefce9361c53cb68a55150b96;p=thirdparty%2Fglibc.git 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 --git a/ChangeLog b/ChangeLog index de58169b612..a67ffe7c538 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2019-06-20 Mike Crowe + * support/test-driver.h: Add verbose_printf macro. + * support/xtime.h: Add xclock_now() helper function. 2019-06-20 Dmitry V. Levin diff --git a/support/test-driver.h b/support/test-driver.h index a9710af0e1c..55f355f50dd 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