[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 10/12] qtest/qmp-cmd-test: Make test build-independent fro
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v4 10/12] qtest/qmp-cmd-test: Make test build-independent from accelerator |
Date: |
Thu, 29 Apr 2021 15:22:43 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Philippe Mathieu-Daudé <philmd@redhat.com> writes:
> On 4/29/21 7:43 AM, Markus Armbruster wrote:
>> Philippe Mathieu-Daudé <philmd@redhat.com> writes:
>>
>>> Now than we can probe if the TCG accelerator is available
>>> at runtime with a QMP command, do it once at the beginning
>>> and only register the tests we can run.
>>> We can then replace the #ifdef'ry by a runtime check.
>>>
>>> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
>>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>
>> Please read the last remark first. The other ones are detail; feel free
>> to skip them until we're done with the last one.
>>
>>> ---
>>> tests/qtest/qmp-cmd-test.c | 18 ++++++++++++++----
>>> 1 file changed, 14 insertions(+), 4 deletions(-)
>
>>> + tcg_accel_available = qtest_has_accel("tcg");
>>> +
>>
>> When does tcg_accel_available differ from defined(CONFIG_TCG)?
>
> qtest_has_accel("tcg") is a runtime check, while defined(CONFIG_TCG)
> is build-time.
Let me rephrase my question: under what conditions can the values of
qtest_has_accel("tcg") and defined(CONFIG_TCG) differ?
> Having tests doing runtime checking allow to:
>
> - have easier reviews, having less #ifdef'ry
> - build them once for all targets
> - build them once for all ./configure options
> (thinking about CI, the a single job could build the tests, then
> we run them using the QEMU binaries from other jobs)
> - use the same binaries to test the built binary and the distribution
> installed one
> - remove the dependencies between tests and binaries
>
>>
>>> g_test_init(&argc, &argv, NULL);
>>>
>>> qmp_schema_init(&schema);
>>
- Re: [PATCH v4 08/12] qtest/bios-tables-test: Make test build-independent from accelerator, (continued)
[PATCH v4 11/12] tests/qtest: Do not restrict bios-tables-test to Aarch64 hosts anymore, Philippe Mathieu-Daudé, 2021/04/15
[PATCH v4 12/12] tests/meson: Only build softfloat objects if TCG is selected, Philippe Mathieu-Daudé, 2021/04/15