From patchwork Thu Jul 4 10:17:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 1956787 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WFCJ8164gz1xpP for ; Thu, 4 Jul 2024 20:17:28 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5CE59384A4BA for ; Thu, 4 Jul 2024 10:17:26 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by sourceware.org (Postfix) with ESMTP id 30F3F384A4B3 for ; Thu, 4 Jul 2024 10:17:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 30F3F384A4B3 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=orcam.me.uk ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 30F3F384A4B3 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4190:8020::34 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720088231; cv=none; b=HzxT6fvaBZNL/DeshYya7xt+5j7MpsEQ2hMi9FzLMF6dPz+jHoNnjIkrXmHTEeCNSEjGuIn7FM4Cc5fDo6hI3gX9rh/g5epmaNlyNYmQCSdDyqEFdryN3Sv6tdku4QRslH44P/MzYkaGMWu3Rg1vGqxsQoHRDMjlVe/WpOz3KRk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1720088231; c=relaxed/simple; bh=6i7cajdp+lL792j9UfEcjhyw3KMoBN9EAw1b7vorRmc=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=hCSwzjlZnFgckcBGBdQjqv2X/YuD3KGVw26HSiBgF6DnbCqxkapzmjVlsPS6A45sn4OH7ft9JozwIF3NI++r+OhJnjUdxMYxtwn10y0kaCQCw80q665qa3UvV1QLYS5IawzuTPwv2pQMqt2Z9Kda2W7x+wvmrA6GnY3vy5tUPhQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by angie.orcam.me.uk (Postfix, from userid 500) id 646BC92009C; Thu, 4 Jul 2024 12:17:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 5D75392009B; Thu, 4 Jul 2024 11:17:08 +0100 (BST) Date: Thu, 4 Jul 2024 11:17:08 +0100 (BST) From: "Maciej W. Rozycki" To: libc-alpha@sourceware.org cc: "Maciej W. Rozycki" Subject: [PATCH v3 1/2] support: Add FAIL test failure helper In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 X-Spam-Status: No, score=-3488.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_INFOUSMEBIZ, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: "Maciej W. Rozycki" Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org From: Maciej W. Rozycki Add a FAIL test failure helper analogous to FAIL_RET, that does not cause the current function to return, providing a standardized way to report a test failure with a message supplied while permitting the caller to continue executing, for further reporting, cleaning up, etc. --- New change in v3. --- support/check.h | 5 +++++ 1 file changed, 5 insertions(+) glibc-support-check-fail.diff Index: glibc/support/check.h =================================================================== --- glibc.orig/support/check.h +++ glibc/support/check.h @@ -25,6 +25,11 @@ __BEGIN_DECLS /* Record a test failure, print the failure message to standard output + and pass the result of 1 through. */ +#define FAIL(...) \ + support_print_failure_impl (__FILE__, __LINE__, __VA_ARGS__) + +/* Record a test failure, print the failure message to standard output and return 1. */ #define FAIL_RET(...) \ return support_print_failure_impl (__FILE__, __LINE__, __VA_ARGS__)