[LTP] [PATCH 3/8] syscalls/waitpid: implement waitpid_ret_test()

Cyril Hrubis chrubis@suse.cz
Thu Aug 18 17:54:23 CEST 2016


Hi!
> #define WAITPID_RET_TEST(wp_pid, wp_status, wp_opts, wp_ret, wp_errno)  \
>         do {                                                            \
>                 if (waitpid_ret_test(wp_pid, wp_status,                 \
>                                      wp_opts, wp_ret, wp_errno)) {      \
>                         tst_res_(__FILE__, __LINE__, TFAIL,             \
>                                  "waitpid_ret_test() failed");          \
>                         return;                                         \
>                 }                                                       \
>         } while (0)
> 
> ?
> 
> This will produce:
> 
> [stas@kholmanskikh waitpid]$ ./waitpid07
> tst_test.c:756: INFO: Timeout per run is 0h 05m 00s
> waitpid_common.h:97: FAIL: waitpid() returned 0, expected 666
> waitpid07.c:51: FAIL: waitpid_ret_test() failed

I guess that we can go this way and turn the last TFAIL into the TINFO.

Well, we may also do something as:

#define TST_TRACE(expr) \
	({int ret = expr; ret != 0 ? tst_res(TINFO, #expr " failed"), ret : ret;})


Then call it as:

	if (TST_TRACE(waitpid_ret_test(...)))
		return;

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list