From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] lib/tst_test.c: Take account of tst_brk(TCONF)/tst_brk(TFAIL) in summary output
Date: Wed, 20 May 2020 10:02:53 +0800 [thread overview]
Message-ID: <5EC48FCD.9050600@cn.fujitsu.com> (raw)
In-Reply-To: <20200519143450.GF16008@yuki.lan>
On 2020/5/19 22:34, Cyril Hrubis wrote:
> Hi!
>> lib/tst_test.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/lib/tst_test.c b/lib/tst_test.c
>> index 0e58060e0..b28521a67 100644
>> --- a/lib/tst_test.c
>> +++ b/lib/tst_test.c
>> @@ -316,6 +316,7 @@ void tst_vbrk_(const char *file, const int lineno, int ttype,
>> const char *fmt, va_list va)
>> {
>> print_result(file, lineno, ttype, fmt, va);
>> + update_results(TTYPE_RESULT(ttype));
>>
>> /*
>> * The getpid implementation in some C library versions may cause cloned
>
> Good catch, but I guess that we should also remove the update_result()
> call from the run_tcases_per_fs() after this.
Hi Cyril,
Agreed. I missed redundant update_result() in run_tcases_per_fs() after
this change.
>
> And it also makes sense to call the function as a first thing in the
> tst_res_/tst_brk_ function, which simplifies the code flow.
It is actually simpler but it changes the original logic of tst_cvres()
called by tst_brk(TBROK) in cleanup().
Before change, tst_cvres() changes TBROK to TWARN and then saves TWARN
into summary output:
----------------------------------
e.g. Add some debug code in preadv01:
[root@Fedora-30 preadv]# ./preadv01
tst_buffers.c:55: INFO: Test is using guarded buffers
tst_test.c:1244: INFO: Timeout per run is 0h 05m 00s
preadv01.c:80: PASS: Preadv(2) read 64 bytes successfully with content
'a' expectedly
preadv01.c:80: PASS: Preadv(2) read 64 bytes successfully with content
'a' expectedly
preadv01.c:80: PASS: Preadv(2) read 32 bytes successfully with content
'b' expectedly
preadv01.c:99: WARN: test
Summary:
passed 3
failed 0
skipped 0
warnings 1
----------------------------------
After change, tst_cvres() changes TBROK to TWARN but doesn't save TWARN
into summary output:
----------------------------------
e.g. Add some debug code in preadv01:
[root@Fedora-30 preadv]# ./preadv01
tst_buffers.c:55: INFO: Test is using guarded buffers
tst_test.c:1245: INFO: Timeout per run is 0h 05m 00s
preadv01.c:80: PASS: Preadv(2) read 64 bytes successfully with content
'a' expectedly
preadv01.c:80: PASS: Preadv(2) read 64 bytes successfully with content
'a' expectedly
preadv01.c:80: PASS: Preadv(2) read 32 bytes successfully with content
'b' expectedly
preadv01.c:99: WARN: test
Summary:
passed 3
failed 0
skipped 0
warnings 0
----------------------------------
I perfer to add a update_results() in tst_vbrk_(), do you think so?
Best Regards,
Xiao Yang
>
> So I guess that we want something like this (not tested):
>
> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index 0e58060e0..9d0ef672d 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -278,8 +278,6 @@ void tst_vres_(const char *file, const int lineno, int ttype,
> const char *fmt, va_list va)
> {
> print_result(file, lineno, ttype, fmt, va);
> -
> - update_results(TTYPE_RESULT(ttype));
> }
>
> void tst_vbrk_(const char *file, const int lineno, int ttype,
> @@ -297,7 +295,6 @@ static void tst_cvres(const char *file, const int lineno, int ttype,
> }
>
> print_result(file, lineno, ttype, fmt, va);
> - update_results(TTYPE_RESULT(ttype));
> }
>
> static void do_test_cleanup(void)
> @@ -337,6 +334,8 @@ void tst_res_(const char *file, const int lineno, int ttype,
> {
> va_list va;
>
> + update_results(TTYPE_RESULT(ttype));
> +
> va_start(va, fmt);
> tst_vres_(file, lineno, ttype, fmt, va);
> va_end(va);
> @@ -347,6 +346,8 @@ void tst_brk_(const char *file, const int lineno, int ttype,
> {
> va_list va;
>
> + update_results(TTYPE_RESULT(ttype));
> +
> va_start(va, fmt);
> tst_brk_handler(file, lineno, ttype, fmt, va);
> va_end(va);
> @@ -1316,10 +1317,8 @@ static int run_tcases_per_fs(void)
> mntpoint_mounted = 0;
> }
>
> - if (ret == TCONF) {
> - update_results(ret);
> + if (ret == TCONF)
> continue;
> - }
>
> if (ret == 0)
> continue;
>
>
next prev parent reply other threads:[~2020-05-20 2:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-18 5:43 [LTP] [PATCH] lib/tst_test.c: Take account of tst_brk(TCONF)/tst_brk(TFAIL) in summary output Xiao Yang
2020-05-19 14:34 ` Cyril Hrubis
2020-05-20 2:02 ` Xiao Yang [this message]
2020-05-22 1:40 ` [LTP] [PATCH v2] lib/tst_test.c: Take account of tst_brk(TCONF/TFAIL) " Xiao Yang
2020-05-26 13:43 ` Xiao Yang
2020-05-27 7:08 ` 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=5EC48FCD.9050600@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox