Linux Test Project
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 1/2] include/tst_test_macros.h: Add TST_EXP_PID and TST_EXP_PID_SILENT macros
Date: Mon, 19 Apr 2021 10:49:43 +0200	[thread overview]
Message-ID: <YH1EJ8BmbYTBOvdk@yuki> (raw)
In-Reply-To: <20210419044112.31443-1-ice_yangxiao@163.com>

Hi!
> Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
> ---
>  include/tst_test_macros.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/include/tst_test_macros.h b/include/tst_test_macros.h
> index 189891507..101ac2c87 100644
> --- a/include/tst_test_macros.h
> +++ b/include/tst_test_macros.h
> @@ -77,6 +77,17 @@ extern void *TST_RET_PTR;
>  				#SCALL, ##__VA_ARGS__);                        \
>  	} while (0)
>  
> +#define TST_EXP_PID_SILENT(SCALL, ...)	TST_EXP_FD_SILENT(SCALL, __VA_ARGS__)

Maybe we should rename the TST_EXP_FD_SILENT() to TST_EXP_POSITIVE() and
then define both TST_EXP_PID_SILENT() and TST_EXP_FD_SILENT() based on
TST_EXP_POSITIVE(), but that's very minor.

Looks good to me:

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

> +#define TST_EXP_PID(SCALL, ...)                                                \
> +	do {                                                                   \
> +		TST_EXP_PID_SILENT(SCALL, __VA_ARGS__);                        \
> +									       \
> +		if (TST_PASS)                                                  \
> +			TST_MSGP_(TPASS, " returned pid %ld", TST_RET,         \
> +				#SCALL, ##__VA_ARGS__);                        \
> +	} while (0)
> +
>  #define TST_EXP_PASS_SILENT(SCALL, ...)                                        \
>  	do {                                                                   \
>  		TEST(SCALL);                                                   \
> -- 
> 2.26.2
> 

-- 
Cyril Hrubis
chrubis@suse.cz

  parent reply	other threads:[~2021-04-19  8:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19  4:41 [LTP] [PATCH v2 1/2] include/tst_test_macros.h: Add TST_EXP_PID and TST_EXP_PID_SILENT macros ice_yangxiao
2021-04-19  4:41 ` [LTP] [PATCH v2 2/2] syscalls/{wait401.c, waitpid01.c}: Take use of TST_EXP_PID_SILENT() ice_yangxiao
2021-04-19  8:55   ` Cyril Hrubis
2021-04-19  8:49 ` Cyril Hrubis [this message]
2021-04-19 10:17   ` [LTP] [PATCH v2 1/2] include/tst_test_macros.h: Add TST_EXP_PID and TST_EXP_PID_SILENT macros Xiao Yang

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=YH1EJ8BmbYTBOvdk@yuki \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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