tests/docker: replicate the check-rust-tools-nightly CI job
authorAlex Bennée <alex.bennee@linaro.org>
Fri, 7 Feb 2025 15:30:56 +0000 (15:30 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Mon, 10 Feb 2025 13:47:58 +0000 (13:47 +0000)
This allows people to run the test locally:

  make docker-test-rust@fedora-rust-nightly

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20250207153112.3939799-2-alex.bennee@linaro.org>

MAINTAINERS
tests/docker/Makefile.include
tests/docker/test-rust [new file with mode: 0755]

index 0091bd1a90f6ddbf31387c55dbf4e69186896e6b..aac74044733a8f166e2cfd875a58074a4214e55f 100644 (file)
@@ -3386,6 +3386,7 @@ F: rust/rustfmt.toml
 
 Rust-related patches CC here
 L: qemu-rust@nongnu.org
+F: tests/docker/test-rust
 F: rust/
 
 SLIRP
index fead7d3abe94b26d7267560b7b7772463279a808..fa1cbb67264be0c688be67ea8c4b62535131a095 100644 (file)
@@ -236,3 +236,6 @@ docker-image: ${DOCKER_IMAGES:%=docker-image-%}
 
 docker-clean:
        $(call quiet-command, $(DOCKER_SCRIPT) clean)
+
+# Overrides
+docker-test-rust%: NETWORK=1
diff --git a/tests/docker/test-rust b/tests/docker/test-rust
new file mode 100755 (executable)
index 0000000..e7e3e94
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/bash -e
+#
+# Run the rust code checks (a.k.a. check-rust-tools-nightly)
+#
+# Copyright (c) 2025 Linaro Ltd
+#
+# Authors:
+#  Alex Bennée <alex.bennee@linaro.org>
+#
+# This work is licensed under the terms of the GNU GPL, version 2
+# or (at your option) any later version. See the COPYING file in
+# the top-level directory.
+
+. common.rc
+
+cd "$BUILD_DIR"
+
+configure_qemu --disable-user --disable-docs --enable-rust
+pyvenv/bin/meson devenv -w $QEMU_SRC/rust ${CARGO-cargo} fmt --check
+make clippy
+make rustdoc