qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Richard W.M. Jones" <rjones@redhat.com>
Cc: qemu-devel@nongnu.org, alxndr@bu.edu, pbonzini@redhat.com,
	bsd@redhat.com, stefanha@redhat.com, darren.kenny@oracle.com,
	Qiuhao.Li@outlook.com, fam@euphon.net, lvivier@redhat.com,
	berrange@redhat.com
Subject: Re: [PATCH] tests: Ensure TAP version is printed before other messages
Date: Wed, 1 Mar 2023 11:56:00 +0100	[thread overview]
Message-ID: <81af679f-e0bf-a3a4-16ba-1d63647de625@redhat.com> (raw)
In-Reply-To: <20230301105214.GZ7636@redhat.com>

On 01/03/2023 11.52, Richard W.M. Jones wrote:
> On Tue, Feb 28, 2023 at 09:30:56PM +0100, Thomas Huth wrote:
>> On 27/02/2023 18.40, Richard W.M. Jones wrote:
>>> These two tests were failing with this error:
>>>
>>>    stderr:
>>>    TAP parsing error: version number must be on the first line
>>>    [...]
>>>    Unknown TAP version. The first line MUST be `TAP version <int>`. Assuming version 12.
>>>
>>> This can be fixed by ensuring we always call g_test_init first in the
>>> body of main.
>>>
>>> Thanks: Daniel Berrange, for diagnosing the problem
>>> Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
>>> ---
>>>   tests/qtest/fuzz-lsi53c895a-test.c | 4 ++--
>>>   tests/qtest/rtl8139-test.c         | 5 +++--
>>>   2 files changed, 5 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/tests/qtest/fuzz-lsi53c895a-test.c b/tests/qtest/fuzz-lsi53c895a-test.c
>>> index a9254b455d..2012bd54b7 100644
>>> --- a/tests/qtest/fuzz-lsi53c895a-test.c
>>> +++ b/tests/qtest/fuzz-lsi53c895a-test.c
>>> @@ -112,12 +112,12 @@ static void test_lsi_do_dma_empty_queue(void)
>>>   int main(int argc, char **argv)
>>>   {
>>> +    g_test_init(&argc, &argv, NULL);
>>> +
>>>       if (!qtest_has_device("lsi53c895a")) {
>>>           return 0;
>>
>> Could you please double-check that the !lsi53c895a case works fine,
>> too? (just temporarily change it into a "if (1) { ..." statement)
>> ... I'm a little bit afraid that the TAP protocol might be
>> incomplete without the g_test_run() at the end otherwise. If so, you
>> might now need a "goto out" instead of the "return 0" here...
> 
> Applying ...
> 
> diff --git a/tests/qtest/fuzz-lsi53c895a-test.c b/tests/qtest/fuzz-lsi53c895a-test.c
> index 2012bd54b7..e0c902aac4 100644
> --- a/tests/qtest/fuzz-lsi53c895a-test.c
> +++ b/tests/qtest/fuzz-lsi53c895a-test.c
> @@ -114,7 +114,7 @@ int main(int argc, char **argv)
>   {
>       g_test_init(&argc, &argv, NULL);
>   
> -    if (!qtest_has_device("lsi53c895a")) {
> +    if (1) {
>           return 0;
>       }
>   
> ... and rerunning the tests, everything still passes.
> 
> The stdout of the test after this change is:
> 
> TAP version 13
> # random seed: R02S1c1f371a09fbfdf0dd747f898d55fe97
> 
> but apparently this version of TAP doesn't care (perhaps because the
> number of tests "1..2" is never printed?)
> 
> Anyway it doesn't appear to be a problem.

Ok, thanks for checking! I just also checked 
https://testanything.org/tap-version-13-specification.html and it says "The 
plan is optional", so this should be fine.

Reviewed-by: Thomas Huth <thuth@redhat.com>




  reply	other threads:[~2023-03-01 10:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27 17:40 [PATCH] tests: Ensure TAP version is printed before other messages Richard W.M. Jones
2023-02-27 17:44 ` Daniel P. Berrangé
2023-02-27 17:46 ` Darren Kenny
2023-02-27 19:57 ` Alexander Bulekov
2023-02-27 22:01 ` Philippe Mathieu-Daudé
2023-02-28 15:37 ` Alex Bennée
2023-02-28 20:30 ` Thomas Huth
2023-03-01 10:52   ` Richard W.M. Jones
2023-03-01 10:56     ` Thomas Huth [this message]
2023-03-01 11:00     ` Daniel P. Berrangé

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=81af679f-e0bf-a3a4-16ba-1d63647de625@redhat.com \
    --to=thuth@redhat.com \
    --cc=Qiuhao.Li@outlook.com \
    --cc=alxndr@bu.edu \
    --cc=berrange@redhat.com \
    --cc=bsd@redhat.com \
    --cc=darren.kenny@oracle.com \
    --cc=fam@euphon.net \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    --cc=stefanha@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).