From: Michael Davidsaver <mdavidsaver@gmail.com>
To: Thomas Huth <thuth@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Antoine Mathys <barsamin@gmail.com>,
qemu-devel@nongnu.org, David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH 2/5] tests: more thorough test of ds1338
Date: Sat, 24 Mar 2018 12:39:16 -0700 [thread overview]
Message-ID: <364d195d-b948-52f4-8c65-2ea535061fe9@gmail.com> (raw)
In-Reply-To: <6b259b00-e185-5ca9-f101-e69a5c8dcbb6@gmail.com>
> On 02/20/2018 09:44 AM, Michael Davidsaver wrote:
>> On 02/18/2018 11:39 PM, Thomas Huth wrote:
...
>> That magic (together with patch 1/5) is IMHO a little bit ugly. I've hit
>> the same problem with the m48t59 test recently, and I solved it by
>> moving the qtest_start() and qtest_end() calls from the main() function
>> into the single tests instead, so that each test starts with a clean state:
>>
>> https://git.qemu.org/?p=qemu.git;a=commitdiff;h=9c29830c90d82f27f
>>
>> Could you maybe try whether that approach works for your test cases
>> here, too? Then you could do this without the "0xff" hack here...
>
> Your right, this looks clearer. I'll try this approach.
I ultimately decided not to go with this approach as test failures
didn't call qtest_quit(), and the process under test is left running
after gtester exits.
Instead I split the current time test off into a second executable.
This avoids all of the magic.
FYI. I also looked at using g_test_add(), keeping the QTestState* in a
Fixture struct, and using setup and teardown functions to call
qtest_start()/qtest_quit(). This works, but seemed to me like too much
effort in this case.
next prev parent reply other threads:[~2018-03-24 19:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-19 4:03 [Qemu-devel] [PATCH 0/5] Generalize Dallas/Maxim I2C RTC devices Michael Davidsaver
2018-02-19 4:03 ` [Qemu-devel] [PATCH 1/5] timer: ds1338 add magic reset for test code Michael Davidsaver
2018-02-19 4:03 ` [Qemu-devel] [PATCH 2/5] tests: more thorough test of ds1338 Michael Davidsaver
2018-02-19 7:39 ` Thomas Huth
2018-02-20 17:44 ` Michael Davidsaver
2018-03-24 19:39 ` Michael Davidsaver [this message]
2018-04-05 10:15 ` Thomas Huth
2018-02-19 4:03 ` [Qemu-devel] [PATCH 3/5] timer: generalize Dallas/Maxim RTC i2c devices Michael Davidsaver
2018-02-22 17:13 ` Peter Maydell
2018-02-19 4:03 ` [Qemu-devel] [PATCH 4/5] tests: ds-rtc-i2c-test test 12 hour mode and DoW Michael Davidsaver
2018-02-19 4:03 ` [Qemu-devel] [PATCH 5/5] tests: drop ds1338-test Michael Davidsaver
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=364d195d-b948-52f4-8c65-2ea535061fe9@gmail.com \
--to=mdavidsaver@gmail.com \
--cc=barsamin@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@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).