@@ -131,12 +131,7 @@ build-system-fedora-rust-nightly:
IMAGE: fedora-rust-nightly
CONFIGURE_ARGS: --disable-docs --enable-rust --enable-strict-rust-lints
TARGETS: aarch64-softmmu
- MAKE_CHECK_ARGS: check-build
- after_script:
- - source scripts/ci/gitlab-ci-section
- - section_start test "Running Rust doctests"
- - cd build
- - pyvenv/bin/meson devenv -w ../rust ${CARGO-cargo} test --doc -p qemu_api
+ MAKE_CHECK_ARGS: check-build check-doc
allow_failure: true
@@ -53,6 +53,17 @@ rust.test('rust-qemu-api-tests', _qemu_api_rs,
qemu_api = declare_dependency(link_with: [_qemu_api_rs],
dependencies: [qemuutil_rs, qemu_api_macros, qom, hwcore, chardev, migration])
+# Doctests are essentially integration tests, so they need the same "depends" as
+# below and cannot be run with "cargo test --doc". Developer tools are only
+# supported for versions 1.74.0 or newer of Rust.
+if rustc.version().version_compare('>=1.74.0')
+ rust.doctest('rust-qemu-api-doctests',
+ _qemu_api_rs,
+ protocol: 'rust',
+ dependencies: qemu_api,
+ suite: ['doc', 'rust'])
+endif
+
test('rust-qemu-api-integration',
executable(
'rust-qemu-api-integration',
Doctest are weird. They are essentially integration tests, but they're "ran" by executing rustdoc --test, which takes a compiler-ish command line. This is supported by Meson 1.8.0. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- .gitlab-ci.d/buildtest.yml | 5 ----- rust/qemu-api/meson.build | 11 +++++++++++ 1 file changed, 12 insertions(+), 6 deletions(-)