From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] TPASS in new test lib
Date: Wed, 16 Sep 2020 12:50:21 +0800 [thread overview]
Message-ID: <5F61998D.7080802@cn.fujitsu.com> (raw)
In-Reply-To: <CY4PR13MB117565A7BA2A8371A3B94ED9FD200@CY4PR13MB1175.namprd13.prod.outlook.com>
On 2020/9/16 4:54, Bird, Tim wrote:
>
>> -----Original Message-----
>> From: Petr Vorel<pvorel@suse.cz>
>>
> ...
>>> P.P.S How come some tests produce TPASS and some produce just PASS?
>> Legacy C API and shell API (both legacy and new) add T (i.e. TPASS), new C API
>> don't add it (i.e. PASS). It's a minor detail we could fix that.
> Well, Fuego's parser only checks for PASS (probably due to the inconsistency),
> but personally I'd prefer if it was consistent. The string "TPASS" is much less
> likely to appear in unrelated output than "PASS" is.
>
> It looks like it comes from print_result() in ltp/lib/tst_test.c.
>
> Here's a patch, in case there's interest in changing it:
>
> > From 151168bf384135d7c79b0c09bb95267ba1293205 Mon Sep 17 00:00:00 2001
> From: Tim Bird<tim.bird@sony.com>
> Date: Tue, 15 Sep 2020 14:18:37 -0600
> Subject: [PATCH] tst_test: Change result strings to use T prefix
>
> Change PASS to TPASS in the new C library.
> Change other results strings to also include the "T" prefix.
> This makes the new library consistent with previous LTP
> output, and with the shell output.
Hi Tim, Petr
Is it better to factor out old strttype() and call it in print_result()?
:-)
Best Regards,
Xiao Yang
> Signed-off-by: Tim Bird<tim.bird@sony.com>
> ---
> lib/tst_test.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index 175dea7..8cc76d5 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -193,22 +193,22 @@ static void print_result(const char *file, const int lineno, int ttype,
>
> switch (TTYPE_RESULT(ttype)) {
> case TPASS:
> - res = "PASS";
> + res = "TPASS";
> break;
> case TFAIL:
> - res = "FAIL";
> + res = "TFAIL";
> break;
> case TBROK:
> - res = "BROK";
> + res = "TBROK";
> break;
> case TCONF:
> - res = "CONF";
> + res = "TCONF";
> break;
> case TWARN:
> - res = "WARN";
> + res = "TWARN";
> break;
> case TINFO:
> - res = "INFO";
> + res = "TINFO";
> break;
> default:
> tst_brk(TBROK, "Invalid ttype value %i", ttype);
next prev parent reply other threads:[~2020-09-16 4:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-15 20:54 [LTP] TPASS in new test lib Bird, Tim
2020-09-16 4:50 ` Xiao Yang [this message]
2020-09-16 7:11 ` Petr Vorel
2020-09-16 8:54 ` Cyril Hrubis
2020-09-16 16:29 ` Bird, Tim
2020-09-17 8:40 ` Cyril Hrubis
2020-09-18 11:45 ` Cyril Hrubis
2020-09-17 10:45 ` Richard Palethorpe
2020-09-17 11:23 ` Petr Vorel
2020-09-17 11:33 ` Petr Vorel
2020-09-17 12:49 ` Cyril Hrubis
2020-09-16 8:43 ` Cyril Hrubis
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=5F61998D.7080802@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.