From patchwork Fri Feb 20 00:19:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1911 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771546823; bh=CFCUQjjGrL/pErnnzt8FaqExOKvXLq9AciodHeCq47U=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Bj4G6mqIG8J19tpPWvZLo2ZnxehMRsEmJGuG3IYS97BRitVZd0k/uYZwOW1UGL6PW 15eLr6etAeTTdCc0nV2VktX0a8e6PT2fXIPVbBK5YdMd6JRH7ShwTOk4XeZiBuH3dr NkgRIWwDIXqyq4PKJQdXqXOedfssj5XnXoZk+LpydDUQxVVRPEoxrOOrC5HNRNNvDn Te7Thw64L1liNsKVgr+6Kqr6b9dfctIzVadhYX/HvwdkdXFFBc4mNp0u4FZHGloPqv jbx7JE3xMfPJWWb6O5MudnELZJRsK1PcjhT98Y/gDPw4p1D7eDU8kZgnYgfg7W7G9c GSoZK29DidaMw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1E97069C8F for ; Thu, 19 Feb 2026 17:20:23 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id CMdf4PH-6lgy for ; Thu, 19 Feb 2026 17:20:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771546823; bh=CFCUQjjGrL/pErnnzt8FaqExOKvXLq9AciodHeCq47U=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Bj4G6mqIG8J19tpPWvZLo2ZnxehMRsEmJGuG3IYS97BRitVZd0k/uYZwOW1UGL6PW 15eLr6etAeTTdCc0nV2VktX0a8e6PT2fXIPVbBK5YdMd6JRH7ShwTOk4XeZiBuH3dr NkgRIWwDIXqyq4PKJQdXqXOedfssj5XnXoZk+LpydDUQxVVRPEoxrOOrC5HNRNNvDn Te7Thw64L1liNsKVgr+6Kqr6b9dfctIzVadhYX/HvwdkdXFFBc4mNp0u4FZHGloPqv jbx7JE3xMfPJWWb6O5MudnELZJRsK1PcjhT98Y/gDPw4p1D7eDU8kZgnYgfg7W7G9c GSoZK29DidaMw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0E84369C87 for ; Thu, 19 Feb 2026 17:20:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771546821; bh=Dn+sxU80BRiIKSvEGNaMVWVxFU40EGnQV9d25Mh7j8M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vxifE2R3nKjPLp26XZoT6OKKjxjmvJCTv9GesrcdX7KxcYQbb6ORYzcj17nHwif23 1z4t5VLevw0ewF3PaqBof4tUaSZGQYV7U8F4sPlFIF2EJpN70xSbJNmTr/DevRgOst I0VLKwojCQ58M5QSB+HKJcU7Ndo5mBuiqeImljNCcOj+jW48SBlzseH7xJL6dgP7uE VSlxmP3CQDzkaeJQ/NzTfUO6S6ZOz71md5Flgcl2kV79lg8m3KTvvNKKTAtxoKf+oj x6tYwxML7wYgaCCtXIVqahiLGuznh27xgLeE4kA/RV/T5H5Pt7bxM38qq1CAQ8SQHU e0kwE0gnY18Hg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0317669C87; Thu, 19 Feb 2026 17:20:21 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id Wjk75Uh0Yc9G; Thu, 19 Feb 2026 17:20:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771546815; bh=Nf+XAes5z2R+RJxSEtqoVrn55ra2ZRKwb2i9CPbZNP0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h5ukRhaTzVGTAjT+dHorpjitwhSgCctEf+mxNDf5VSZ0SLoYCh5FnJSHYNCdCz17I 9AB72cTUCodtX1ckfwMOMB4IJb/o40k/7cuaVHLBibw9c0SlsTYFTgNULL7IWBnX/J wSsX+rCVFL6nL0XHhaRgGgcZtksq54SuVMvmbegD5ZxTI8YxbzLLworsYgZLyy/2NJ hx31T8En4gCF2496aVEu4RxcqjrZRDwW433qRqdOJ+rOpl74LOj2bi+bISD12IPGWc Yoz4+fhJhmTTU5DaIfLY8e3yOqbF2yTuLPUyOadJ0rwEuzUBgLw1nE6DVC4qOXHtko 4rtokpQWWuCWw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2813569C0B; Thu, 19 Feb 2026 17:20:15 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 19 Feb 2026 17:19:17 -0700 Message-ID: <20260220001926.2366140-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260220001926.2366140-1-sjg@u-boot.org> References: <20260220001926.2366140-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: LDAA7KAVPVS3ODJZFG6TWCL6UZ6IECLV X-Message-ID-Hash: LDAA7KAVPVS3ODJZFG6TWCL6UZ6IECLV X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 6" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/13] ulib: riscv: Add Rust demo test for qemu-riscv64 List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a run_bios_rust_demo() helper that mirrors run_bios_demo() but boots rust-demo.bin instead of demo.bin, and a test_ulib_rust_demo_riscv64 test that exercises it under qemu-system-riscv64. Co-developed-by: Claude Opus 4.6 Signed-off-by: Simon Glass --- test/py/tests/test_ulib.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/test/py/tests/test_ulib.py b/test/py/tests/test_ulib.py index 2090a06efbc..b6fa30bcfd2 100644 --- a/test/py/tests/test_ulib.py +++ b/test/py/tests/test_ulib.py @@ -357,6 +357,34 @@ def run_bios_demo(ubman, qemu_binary, extra_qemu_args=None): out = run_qemu_demo(cmd) assert_demo_output(out) +def run_bios_rust_demo(ubman, qemu_binary, extra_qemu_args=None): + """Boot the rust-demo.bin binary under QEMU and check expected output. + + Locates rust-demo.bin in the build directory, launches the given QEMU + binary with it as -bios, and asserts that the expected demo output + is present. + + Args: + ubman (ConsoleBase): Test fixture providing build directory + etc. + qemu_binary (str): QEMU system binary + (e.g. 'qemu-system-riscv64') + extra_qemu_args (list): Additional QEMU arguments + """ + build = ubman.config.build_dir + demo_bin = os.path.join(build, 'examples', 'ulib', 'rust-demo.bin') + + assert os.path.exists(demo_bin), \ + 'rust-demo.bin not found in build directory' + assert shutil.which(qemu_binary), f'{qemu_binary} not found' + + cmd = [qemu_binary, '-machine', 'virt', '-nographic', '-no-reboot', + '-bios', demo_bin] + if extra_qemu_args: + cmd += extra_qemu_args + out = run_qemu_demo(cmd) + assert_demo_output(out) + @pytest.mark.localqemu @pytest.mark.boardspec('qemu_arm64') @pytest.mark.buildconfigspec("examples") @@ -371,6 +399,13 @@ def test_ulib_demo_riscv64(ubman): """Test the ulib demo binary under QEMU RISC-V 64.""" run_bios_demo(ubman, 'qemu-system-riscv64') +@pytest.mark.localqemu +@pytest.mark.boardspec('qemu-riscv64') +@pytest.mark.buildconfigspec("rust_examples") +def test_ulib_rust_demo_riscv64(ubman): + """Test the Rust ulib demo binary under QEMU RISC-V 64.""" + run_bios_rust_demo(ubman, 'qemu-system-riscv64') + def run_efi_demo(ubman, qemu_binary, fw_code, fw_vars, extra_qemu_args=None): """Run a ulib demo EFI application under QEMU with UEFI firmware.