[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: QEMU tests, Coverity, and g_test_set_nonfatal_assertions()
From: |
Markus Armbruster |
Subject: |
Re: QEMU tests, Coverity, and g_test_set_nonfatal_assertions() |
Date: |
Wed, 05 May 2021 10:36:10 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Peter Maydell <peter.maydell@linaro.org> writes:
[...]
> In summary, we have a few options:
>
> (1) Expand "assertions always fatal" to test code, and add "panics"
> models of the g_assertion_message* functions. Remove all the calls
> to g_test_set_nonfatal_assertions().
>
> (2) Aim to expand the ability to use g_test_set_nonfatal_assertions()
> to other tests than the handful that currently use it (perhaps by
> providing a standard place where it gets called for all tests, though
> there isn't currently an obvious place to do that). Treat Coverity
> issues in our test code which flag up "this would crash if the
> assertion fired but execution continued" as bugs to be fixed (though
> not very high-priority ones, obviously).
Further discussed under Richard's reply.
> (3) Something else ?
We could try to model what the GLib functions do:
g_test_set_nonfatal_assertions() sets a global flag, the g_assert_FOO()
other than g_assert_not_reached() check it. We'll then find out whether
Coverity's analysis is strong enough to propagate the value passed to
g_test_set_nonfatal_assertions() to its uses.
[...]