From patchwork Tue Jun 18 16:33:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Crowe X-Patchwork-Id: 1118129 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-102815-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mcrowe.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="eVGQtHwo"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45StvQ4fX8z9s9y for ; Wed, 19 Jun 2019 02:34:10 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; q=dns; s= default; b=EekMf5BVknJIekvx5a2Fz+kMj6gzpzXSwahz6QJdrW2VEN2TXNAk1 W5TiTpxE3knDNRYzghtIiDNjbGv1kx4ImUfqVV9X/A0F4z0jT6moc6ea0AjObvP9 7KXqATbNyWa4HBZOCWRKMlHpIRBY2ocmjh3TnmkGXAO0WF4w2cAA1M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; s=default; bh=xCMqgDgE4SwAOTkHPznyCmaLpNo=; b=eVGQtHwozbrkoCk6cqZNeYBi48MB mTYWYhBjqa9aYgavMZZyerDALjxOUnupEWBU6So4Tt5pCDHltbgletyGRToyFEC3 va4NibJRByw+pl7bck4nMTSfwIhdRSFQACrs3GnQNY4MJ77skV0t6vezY2+SNXnF Vdj3kK73DOZQjAs= Received: (qmail 101267 invoked by alias); 18 Jun 2019 16:34:03 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 101259 invoked by uid 89); 18 Jun 2019 16:34:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: avasout02.plus.net X-CM-Score: 0.00 From: Mike Crowe To: libc-alpha@sourceware.org Cc: Mike Crowe Subject: [PATCH v4 02/12] support: Invent verbose_printf macro Date: Tue, 18 Jun 2019 17:33:42 +0100 Message-Id: <0b902958389af995048eb22af8760e615e5f3fab.1560875584.git-series.mac@mcrowe.com> In-Reply-To: References: MIME-Version: 1.0 Make it easier for tests to emit progress messages only when --verbose is specified. * support/test-driver.h: Add verbose_printf macro. --- ChangeLog | 4 ++++ support/test-driver.h | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 17fd6ac..6943d5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2019-06-18 Mike Crowe + + * support/test-driver.h: Add verbose_printf macro. + 2019-05-30 Mike Crowe * support/xtime.h: Add xclock_now() helper function. 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