mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
rust: build integration test for the qemu_api crate
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. Reviewed-by: Junjie Mao <junjie.mao@hotmail.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
4f7521916d
commit
cde3c425d1
5 changed files with 110 additions and 56 deletions
10
meson.build
10
meson.build
|
@ -3345,7 +3345,15 @@ if have_rust and have_system
|
|||
|
||||
# Prohibit code that is forbidden in Rust 2024
|
||||
rustc_args += ['-D', 'unsafe_op_in_unsafe_fn']
|
||||
add_project_arguments(rustc_args, native: false, language: 'rust')
|
||||
|
||||
# Apart from procedural macros, our Rust executables will often link
|
||||
# with C code, so include all the libraries that C code needs. This
|
||||
# is safe; https://github.com/rust-lang/rust/pull/54675 says that
|
||||
# passing -nodefaultlibs to the linker "was more ideological to
|
||||
# start with than anything".
|
||||
add_project_arguments(rustc_args + ['-C', 'default-linker-libraries'],
|
||||
native: false, language: 'rust')
|
||||
|
||||
add_project_arguments(rustc_args, native: true, language: 'rust')
|
||||
endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue