From patchwork Mon Feb 16 01:34:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1886 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=1771205752; bh=P1DWGyIEpfGNjkukUf9CpgCquRDJNt2Q9xW+uISMnPI=; 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=P/F1o2RivCfH09fMtorDWjTk3YhAgbfvNotGaTPGkEwxP4369prqWyDkKGbZzmx9a /a0T9CjX4CdEts8rgractdsmYZLdt3byfATcq/gkr5tjJbMkV7fNIR0nvIZafy/bjv m5MAI9cNAUvo2e9uc4xKHOUgjvHfXevlVJjT78e21j3sgQbnTKRjpkNXvfMbvHIVLd XCOXnfMvB8rE7DobRA0LOD/oYtB52oFIKsvm9mdEeTHzXE5MGrHNr8k1uh1Ed9Hs3u W0j3oO0wu0OWM+2gQC+SV5//dz0RX0VqLSmfPAJ2K/s/6N19yYKRXHi+TRPnbMWEi8 nJ5lT31qzg4Ig== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EE70D69B01 for ; Sun, 15 Feb 2026 18:35:52 -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 MBBlOWUYR4b1 for ; Sun, 15 Feb 2026 18:35:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205751; bh=P1DWGyIEpfGNjkukUf9CpgCquRDJNt2Q9xW+uISMnPI=; 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=StJ/bFQl8uSvyQa43m89VEE1m7xtSJpO/wbLUJ51IKjvK5DGm5KhTEL0Z0IJ2WJ0n a+pjKTMYZZxK/eDgJVJuTtkZcYjs8VR98EvKuOit/MeokGpP0/UrRAkky2+v5FiCwF r550p7lG+Ll8Ve5k89M+2lufrTtXI7IdRaDTfECgP1gI3nOqMr+QMJCpxyysbZCHXX 98yNJghUeCiJZLM+lpEE9KfqYv4ydY6r++milBURIuHrUZp5FAPBOnslMpuHLAAflp d7Vj7ogLdkmvCaHuTglEKtWE/RZqR31/bJKVsJ42rNdDLLCJVc2m0h8Vee5VrAqyi8 TpGIgj5EA3a/Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 455D869BDD for ; Sun, 15 Feb 2026 18:35:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205749; bh=Z+HUXhz6h2tiS64Tv/7wr64cfpHqGhQPAIhzqBwWkaU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tut7lozqLKq2TdGnD0+L/KTu7wbPkw0LG44Cvn5tXdl/JCpkO1hKb0UVyjWR0iXVu ATsZTr6YJpWtLia+VVDdZaaSCPEotObpIZhr1Yib+47jgPn6dkXaPhIVqBoI2ZLGd/ a9kvdYQdn/nysBU/nge3Zj9SJSDWbLBlVl6lg9SF2qwkwORBwAEULK4/hux9lt1jsM 8+ELmbwdYu1m/jfPxt2ZeYix6BspfdmnJjhIVNtYiIdjdAsfcFC1d4bGZH2ooi0zTM 7cxafVjWK+YAvjNpiAMwcktnWqwZQrcjj1LpFW+zRghYts3pVCVwWjylazECSOvOJQ rHy1N2e84LcfQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6066869B01; Sun, 15 Feb 2026 18:35:49 -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 PJurQAa9BGhC; Sun, 15 Feb 2026 18:35:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205749; bh=eBswu9vi9d7TXOtxThaWNzMdlLeinR1kx3o1VKo8Fms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tYzHgwmGVKCGIirm3LTZ67uDJOHLFdzQDnymg42+SEZr1EMuX/uA+DJ/QwZ8jVE6Y F+yar8airKjgKB4elH3cIbVcct4otJ8LxFO5IMQ3KZx2FUg0nBY9oWz4Ef72IPKM4i O64MMaS7YWOYJQ9oQiQd9RYvRRqLTJyPnwdENcsv+P27cDZYzrtH8flOW7SSgsVIWu mPHYy5/nOVvQtivxg5Y2kInoc85IOnl3b9QjVDsnZxhtfsILQKFoaRGZQg865IwR5M sUIAn/Z4H0W60RJnTTjtwOI2mET4JpqUumBS1Vl2EA+oF7lFL6y7inMmjjQ6nQxpyl S5EbfSC3RelKQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B70D369AD9; Sun, 15 Feb 2026 18:35:48 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 15 Feb 2026 18:34:54 -0700 Message-ID: <20260216013511.4079770-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260216013511.4079770-1-sjg@u-boot.org> References: <20260216013511.4079770-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: GRLZ665DLJLRRLM4F3VZXV33UQER25JW X-Message-ID-Hash: GRLZ665DLJLRRLM4F3VZXV33UQER25JW 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 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 06/17] ulib: x86: Add demo pytest for qemu-x86_64_nospl 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 Enable CONFIG_ULIB and CONFIG_EXAMPLES in qemu-x86_64_nospl_defconfig so that the demo.rom binary is built. Add test_ulib_demo_rom_64() which boots demo.rom under qemu-system-x86_64 and verifies the expected output, following the same pattern as the existing qemu-x86 test. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- configs/qemu-x86_64_nospl_defconfig | 2 ++ test/py/tests/test_ulib.py | 37 ++++++++++++++++++++++------- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/configs/qemu-x86_64_nospl_defconfig b/configs/qemu-x86_64_nospl_defconfig index 4452b8c6e0a..950d2d2e419 100644 --- a/configs/qemu-x86_64_nospl_defconfig +++ b/configs/qemu-x86_64_nospl_defconfig @@ -79,4 +79,6 @@ CONFIG_CONSOLE_SCROLL_LINES=5 CONFIG_GENERATE_ACPI_TABLE=y CONFIG_CMD_DHRYSTONE=y # CONFIG_GZIP is not set +CONFIG_ULIB=y +CONFIG_EXAMPLES=y CONFIG_UNIT_TEST=y diff --git a/test/py/tests/test_ulib.py b/test/py/tests/test_ulib.py index 957417ede31..b1ce5792801 100644 --- a/test/py/tests/test_ulib.py +++ b/test/py/tests/test_ulib.py @@ -221,19 +221,26 @@ def test_ulib_api_header(ubman): assert 'ub_snprintf(char *buf, size_t size, const char *fmt, ...)' in out assert 'ub_vprintf(const char *fmt, va_list args)' in out -@pytest.mark.localqemu -@pytest.mark.boardspec('qemu-x86') -@pytest.mark.buildconfigspec("examples") -def test_ulib_demo_rom(ubman): - """Test the ulib demo ROM image under QEMU x86.""" +def run_x86_rom_demo(ubman, qemu_binary): + """Boot the demo ROM image under QEMU and check for expected output. + + Locates demo.rom in the build directory, launches the given QEMU + binary with it, 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-i386') + """ build = ubman.config.build_dir demo_rom = os.path.join(build, 'demo.rom') assert os.path.exists(demo_rom), 'demo.rom not found in build directory' - assert shutil.which('qemu-system-i386'), 'qemu-system-i386 not found' + assert shutil.which(qemu_binary), f'{qemu_binary} not found' + + cmd = [qemu_binary, '-bios', demo_rom, '-nographic', '-no-reboot'] - cmd = ['qemu-system-i386', '-bios', demo_rom, '-nographic', - '-no-reboot'] with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as proc: try: @@ -250,3 +257,17 @@ def test_ulib_demo_rom(ubman): assert 'helper: Adding 42 + 13 = 55' in out assert '=================================' in out assert 'Demo complete' in out + +@pytest.mark.localqemu +@pytest.mark.boardspec('qemu-x86') +@pytest.mark.buildconfigspec("examples") +def test_ulib_demo_rom(ubman): + """Test the ulib demo ROM image under QEMU x86.""" + run_x86_rom_demo(ubman, 'qemu-system-i386') + +@pytest.mark.localqemu +@pytest.mark.boardspec('qemu-x86_64_nospl') +@pytest.mark.buildconfigspec("examples") +def test_ulib_demo_rom_64(ubman): + """Test the ulib demo ROM image under QEMU x86_64.""" + run_x86_rom_demo(ubman, 'qemu-system-x86_64')