From patchwork Wed Aug 11 09:21:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Hrubis X-Patchwork-Id: 1515718 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=Lb0Rq8FM; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=A53o7jSu; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Gl48J3Dqkz9sWS for ; Wed, 11 Aug 2021 19:21:51 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 2EFF83C700B for ; Wed, 11 Aug 2021 11:21:48 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [IPv6:2001:4b78:1:20::4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id B48BB3C32BD for ; Wed, 11 Aug 2021 11:21:40 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id A8E281000A38 for ; Wed, 11 Aug 2021 11:21:39 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A9A851FEBA; Wed, 11 Aug 2021 09:21:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1628673698; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=SZj2xFFYlXeOBJ3NhA6qpuSwAdUxYHoazCDt2hkpdzY=; b=Lb0Rq8FMkN5y9y9EWRqQ/u2Xi8ulrz5K8gaZ6hJhziXEcKUbmuoTL99wBOZQ7YXE0xzGn0 KTNaPasPrYMvWpC8oww3uSwPbNjNPT1TZ53TbNyFO3hp4Q5a0SxPGdLahbiq1uLkBCA8JO cxW7dPmAfq4jv/6aXCtAe3V7Bg7v9c8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1628673698; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=SZj2xFFYlXeOBJ3NhA6qpuSwAdUxYHoazCDt2hkpdzY=; b=A53o7jSuGISGlGbqnXv72k8Fd0bjWwypNDLDTVK5LRZHTcWrYP/xlcYCJNVzUw0cIXM9yX 4N7N5VeZ1MGzr0BQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 654EE13BFC; Wed, 11 Aug 2021 09:21:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id p0C8GKKWE2G8bwAAMHmgww (envelope-from ); Wed, 11 Aug 2021 09:21:38 +0000 From: Cyril Hrubis To: ltp@lists.linux.it Date: Wed, 11 Aug 2021 11:21:49 +0200 Message-Id: <20210811092149.11287-1-chrubis@suse.cz> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.9 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,UPPERCASE_50_75 autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH] tst_test_macros.h: Make TST_EXP_POSSITIVE() print TPASS as well X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sujiaxun Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" So that it could be used in the tests. Signed-off-by: Cyril Hrubis CC: sujiaxun Reviewed-by: Petr Vorel --- include/tst_test_macros.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/include/tst_test_macros.h b/include/tst_test_macros.h index cd65d8d0d..d9d7f930f 100644 --- a/include/tst_test_macros.h +++ b/include/tst_test_macros.h @@ -46,7 +46,7 @@ extern void *TST_RET_PTR; tst_res_(__FILE__, __LINE__, RES, \ TST_FMT_(TST_2_(dummy, ##__VA_ARGS__, SCALL) FMT, __VA_ARGS__), PAR) -#define TST_EXP_POSITIVE(SCALL, ...) \ +#define TST_EXP_POSITIVE_(SCALL, ...) \ do { \ TEST(SCALL); \ \ @@ -68,7 +68,17 @@ extern void *TST_RET_PTR; \ } while (0) -#define TST_EXP_FD_SILENT(SCALL, ...) TST_EXP_POSITIVE(SCALL, __VA_ARGS__) +#define TST_EXP_POSITIVE(SCALL, ...) \ + do { \ + TST_EXP_POSITIVE_(SCALL, __VA_ARGS__); \ + \ + if (TST_PASS) { \ + TST_MSGP_(TPASS, " returned %ld", \ + TST_RET, #SCALL, ##__VA_ARGS__); \ + } \ + } while (0) + +#define TST_EXP_FD_SILENT(SCALL, ...) TST_EXP_POSITIVE_(SCALL, __VA_ARGS__) #define TST_EXP_FD(SCALL, ...) \ do { \ @@ -79,7 +89,7 @@ extern void *TST_RET_PTR; #SCALL, ##__VA_ARGS__); \ } while (0) -#define TST_EXP_PID_SILENT(SCALL, ...) TST_EXP_POSITIVE(SCALL, __VA_ARGS__) +#define TST_EXP_PID_SILENT(SCALL, ...) TST_EXP_POSITIVE_(SCALL, __VA_ARGS__) #define TST_EXP_PID(SCALL, ...) \ do { \