Paolo Bonzini <pbonzini@redhat.com> writes:
> Adjust the integration test to compile with a subset of QEMU object
> files, and make it actually create an object of the class it defines.
>
> Follow the Rust filesystem conventions, where tests go in tests/ if
> they use the library in the same way any other code would.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Junjie Mao <junjie.mao@hotmail.com>
A few minor comments on cosmetic below.
> ---
> meson.build | 10 ++++-
> rust/qemu-api/meson.build | 20 +++++++--
> rust/qemu-api/src/tests.rs | 49 ----------------------
> rust/qemu-api/tests/tests.rs | 78 ++++++++++++++++++++++++++++++++++++
> 4 files changed, 104 insertions(+), 53 deletions(-)
> delete mode 100644 rust/qemu-api/src/tests.rs
> create mode 100644 rust/qemu-api/tests/tests.rs
>
<snip>
> diff --git a/rust/qemu-api/tests/tests.rs b/rust/qemu-api/tests/tests.rs
> new file mode 100644
> index 00000000000..57bab62772d
> --- /dev/null
> +++ b/rust/qemu-api/tests/tests.rs
> @@ -0,0 +1,78 @@
> +// Copyright 2024, Linaro Limited
> +// Author(s): Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +
> +use core::ffi::CStr;
> +
> +use qemu_api::{
> + bindings::*, declare_properties, define_property,
> + definitions::Class,
> + definitions::ObjectImpl,
> + device_class_init, vm_state_description,
Cargo fmt (with the current rust/rustfmt.toml) formats those lines in a
different way, and ...