From: yangx.jy <yangx.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [RFC PATCH 2/2] include/tst_test_macros.h: Report TINFO when TST_EXP_FD() succeeded
Date: Mon, 4 Jan 2021 21:07:03 +0800 [thread overview]
Message-ID: <5FF312F7.1060907@cn.fujitsu.com> (raw)
In-Reply-To: <20210104125423.19183-2-yangx.jy@cn.fujitsu.com>
Hi Cyril,
I will change the TST_EXP_PASS as well if you approve the patch.
Best Regards,
Xiao Yang
On 2021/1/4 20:54, Xiao Yang wrote:
> In Summary output, avoid counting the double passed for one test:
> -------------------------------------
> ./open01
> tst_test.c:1261: TINFO: Timeout per run is 0h 05m 00s
> open01.c:48: TPASS: open() with sticky bit returned fd 3
> open01.c:59: TPASS: sticky bit is set as expected
> open01.c:48: TPASS: open() with sirectory bit returned fd 3
> open01.c:59: TPASS: sirectory bit is set as expected
>
> Summary:
> passed 4
> failed 0
> broken 0
> skipped 0
> warnings 0
> -------------------------------------
>
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
> include/tst_test_macros.h | 2 +-
> lib/newlib_tests/test_macros01.c | 3 ++-
> testcases/kernel/syscalls/open/open11.c | 2 ++
> 3 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/include/tst_test_macros.h b/include/tst_test_macros.h
> index 3016d95c2..d1fc3cf70 100644
> --- a/include/tst_test_macros.h
> +++ b/include/tst_test_macros.h
> @@ -64,7 +64,7 @@ extern void *TST_RET_PTR;
> break; \
> } \
> \
> - TST_MSGP_(TPASS, " returned fd %ld", TST_RET, \
> + TST_MSGP_(TINFO, " returned fd %ld", TST_RET, \
> #SCALL, ##__VA_ARGS__); \
> \
> TST_PASS = 1; \
> diff --git a/lib/newlib_tests/test_macros01.c b/lib/newlib_tests/test_macros01.c
> index 9a920f8e4..9aa3885c7 100644
> --- a/lib/newlib_tests/test_macros01.c
> +++ b/lib/newlib_tests/test_macros01.c
> @@ -30,7 +30,8 @@ static void do_test(void)
> TST_EXP_FD(fail_fd(), "TEST DESCRIPTION");
> tst_res(TINFO, "TST_PASS = %i", TST_PASS);
> TST_EXP_FD(pass_fd(), "%s", "TEST DESCRIPTION PARAM");
> - tst_res(TINFO, "TST_PASS = %i", TST_PASS);
> + if (TST_PASS)
> + tst_res(TPASS, "TST_PASS = %i", TST_PASS);
> TST_EXP_FD(inval_val());
> tst_res(TINFO, "TST_PASS = %i", TST_PASS);
> }
> diff --git a/testcases/kernel/syscalls/open/open11.c b/testcases/kernel/syscalls/open/open11.c
> index ded384fa8..f7ac96d90 100644
> --- a/testcases/kernel/syscalls/open/open11.c
> +++ b/testcases/kernel/syscalls/open/open11.c
> @@ -283,6 +283,8 @@ static void verify_open(unsigned int n)
> } else if (tc[n].err == 0) {
> TST_EXP_FD(open(tc[n].path, tc[n].flags, tc[n].mode),
> "%s", tc[n].desc);
> + if (TST_PASS)
> + tst_res(TPASS, "%s", tc[n].desc);
> } else {
> TEST(open(tc[n].path, tc[n].flags, tc[n].mode));
> tst_res(TPASS, "%s", tc[n].desc);
next prev parent reply other threads:[~2021-01-04 13:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-04 12:54 [LTP] [PATCH 1/2] syscalls/open01.c: Don't continue when open() failed Xiao Yang
2021-01-04 12:54 ` [LTP] [RFC PATCH 2/2] include/tst_test_macros.h: Report TINFO when TST_EXP_FD() succeeded Xiao Yang
2021-01-04 13:07 ` yangx.jy [this message]
2021-01-05 13:38 ` Cyril Hrubis
2021-01-05 13:36 ` Cyril Hrubis
2021-01-05 14:39 ` yangx.jy
2021-01-05 15:03 ` Cyril Hrubis
2021-01-10 13:04 ` [LTP] [RFC PATCH v2 1/2] include/tst_test_macros.h: Add TST_EXP_SILENT_{PASS, FD} macros Xiao Yang
2021-01-10 13:04 ` [LTP] [RFC PATCH v2 2/2] syscalls/access02.c: Take use of TST_EXP_SILENT_PASS Xiao Yang
2021-01-11 14:07 ` [LTP] [RFC PATCH v2 1/2] include/tst_test_macros.h: Add TST_EXP_SILENT_{PASS, FD} macros Cyril Hrubis
2021-01-10 13:48 ` [LTP] [RFC PATCH 2/2] include/tst_test_macros.h: Report TINFO when TST_EXP_FD() succeeded yangx.jy
2021-01-05 13:15 ` [LTP] [PATCH 1/2] syscalls/open01.c: Don't continue when open() failed Cyril Hrubis
2021-01-05 14:20 ` yangx.jy
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=5FF312F7.1060907@cn.fujitsu.com \
--to=yangx.jy@cn.fujitsu.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.