From patchwork Mon Feb 16 01:34:52 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1884 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=1771205745; bh=3+e3bKRK17377pywV/oZhfnH/dRAii49Uy4t8ue/9Xw=; 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=AsfbPSuDJAcojSDTFoNxJ18TFmmJRPnPiciu/PtBH++wB1c25Zovm6CEWHsyiaHIA NhxPVao7ueen8waV3oM7iq1IElpU4sF1rHD3SJ6mfIA1w6Q58AiChBMEQRS4n6nWsq tP0NJg6qiZww8mW3qTjGE4zrkQtfWqgfQ68wfi48L//l59emFpi7LFY+Hhni/8/WeX apcL7v86PVky8REy3cfDLxKFVlHuBy/Go9SbpiPspViyGFPBuxPVJ+ESwOV7kFBPlX LdQC1fWSZsDYmDpeqMzA8zp67i61DjJ1wyoYes6YJ+mN7hPYEEb6r+lXBIeFy4kf4W r/XJZk7lpLRmg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2AE0A69BD8 for ; Sun, 15 Feb 2026 18:35:45 -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 wFFMAgnaDPp8 for ; Sun, 15 Feb 2026 18:35:45 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205745; bh=3+e3bKRK17377pywV/oZhfnH/dRAii49Uy4t8ue/9Xw=; 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=AsfbPSuDJAcojSDTFoNxJ18TFmmJRPnPiciu/PtBH++wB1c25Zovm6CEWHsyiaHIA NhxPVao7ueen8waV3oM7iq1IElpU4sF1rHD3SJ6mfIA1w6Q58AiChBMEQRS4n6nWsq tP0NJg6qiZww8mW3qTjGE4zrkQtfWqgfQ68wfi48L//l59emFpi7LFY+Hhni/8/WeX apcL7v86PVky8REy3cfDLxKFVlHuBy/Go9SbpiPspViyGFPBuxPVJ+ESwOV7kFBPlX LdQC1fWSZsDYmDpeqMzA8zp67i61DjJ1wyoYes6YJ+mN7hPYEEb6r+lXBIeFy4kf4W r/XJZk7lpLRmg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 19F5E69BCC for ; Sun, 15 Feb 2026 18:35:45 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205743; bh=qw1ep4haejEqn2t8jkLzdrgulV97RCcAEEUvJDgMzBE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U9M+anMyy9tkg6ZIyKAmf/EY9KpOvYAEGYt3Dg+kdMjYRekn2iPs5I2lkaCju9ELj AQrgeRMI9bLvwyHPXoH0A1oVdFF8qoU2tR2tRcIvI6I2V38FIRTs7Prv0qKGYCwzIQ JarD/2dJMUDDlfzwdAiuPV1QzvZK3Xupbxf/4fSm4Ar+TXm5Rh8s7cklmpabE1ZIWv G00iJWbQBsn/3McdxlriIozJXGFrTL0Yl+nvAjP8PsGYEUsaaDDadsMxps+OTLy2mE Pe5m/x53i3oOnNz+eQM9b0elBHOIKDfGa7QgbK5nH6zVPgwCAsTjCHjOOBOpdQEV4F Dm4CotdyriWSg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CAB3169B01; Sun, 15 Feb 2026 18:35:43 -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 cPXfp_-zqWaj; Sun, 15 Feb 2026 18:35:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205741; bh=jHOJZdGbjeArm3wkaS/zRG4PXWtto06uwJD8J+fKU+Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uMG5ORN+pce9IGGut5fQ9Qg73HWyUho1OInXc6PinqvAwfgeRyYYzIkwC5A9dkSwB x87P1/v15kZmD4hz3bLQjOih5Jqyifuy2lMPcAPIh1Der3BsWNBhG3G1v2g7zhpayu k7n/UmSVFI7jAhr2Ne9BxtsDZ0SbJuyZRWBDOJjqVUCoERd4AwTcqZL9UX8rp1yrtp 1S0MAYkcotXzSV7zc554bRgeLAeSQAQGsS7wPCuJfmOPgVLtXWP3bzcNAs+4OL2ulM JZQF174mzxnoc3B3m0MXcjtc2kQwoPEDTaQRiKExVGE0qnK8JZPGw6SBge2q3TCqAd e8LRJ/702anqQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 10A9569AD9; Sun, 15 Feb 2026 18:35:41 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 15 Feb 2026 18:34:52 -0700 Message-ID: <20260216013511.4079770-5-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: CY43ZMDIXW4KTIKLL2DPP4ZHDAUSNVUY X-Message-ID-Hash: CY43ZMDIXW4KTIKLL2DPP4ZHDAUSNVUY 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 04/17] ulib: test: Detect clang instead of checking binaries 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 The ulib tests skip when build artefacts are missing, with a comment saying this happens with clang. This is fragile since a missing binary for any other reason is silently skipped. Use ubman.config.buildconfig to check for CONFIG_CC_IS_CLANG and skip explicitly when clang is detected. Otherwise assert that the expected artefacts exist, so a genuine build failure is reported as a test failure. Add boardspec('sandbox') to test_ulib_shared since it runs a host binary directly, which only works on sandbox. Co-developed-by: Claude Opus 4.6 Signed-off-by: Simon Glass --- test/py/tests/test_ulib.py | 41 ++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/test/py/tests/test_ulib.py b/test/py/tests/test_ulib.py index 16af47fd840..957417ede31 100644 --- a/test/py/tests/test_ulib.py +++ b/test/py/tests/test_ulib.py @@ -16,6 +16,7 @@ def check_output(out): assert 'Uses libc printf before ulib_init' in out assert 'another printf()' in out +@pytest.mark.boardspec('sandbox') @pytest.mark.buildconfigspec("ulib") def test_ulib_shared(ubman): """Test the ulib shared library test program""" @@ -23,9 +24,11 @@ def test_ulib_shared(ubman): build = ubman.config.build_dir prog = os.path.join(build, 'test', 'ulib', 'ulib_test') - # Skip test if ulib_test doesn't exist (clang) - if not os.path.exists(prog): - pytest.skip('ulib_test not found - library build may be disabled') + # ulib is not yet supported with clang + if ubman.config.buildconfig.get('config_cc_is_clang'): + pytest.skip('ulib not supported with clang') + + assert os.path.exists(prog), 'ulib_test not found in build dir' out = utils.run_and_log(ubman, [prog], cwd=build) check_output(out) @@ -38,9 +41,11 @@ def test_ulib_static(ubman): build = ubman.config.build_dir prog = os.path.join(build, 'test', 'ulib', 'ulib_test_static') - # Skip test if ulib_test_static doesn't exist (clang) - if not os.path.exists(prog): - pytest.skip('ulib_test_static not found - library build may be disabled') + # ulib is not yet supported with clang + if ubman.config.buildconfig.get('config_cc_is_clang'): + pytest.skip('ulib not supported with clang') + + assert os.path.exists(prog), 'ulib_test_static not found in build directory' out = utils.run_and_log(ubman, [prog]) check_output(out) @@ -115,9 +120,11 @@ def test_ulib_demos(ubman): examples = os.path.join(src, 'examples', 'ulib') test_program = os.path.join(build, 'test', 'ulib', 'ulib_test') - # Skip test if ulib_test doesn't exist (clang) - if not os.path.exists(test_program): - pytest.skip('ulib_test not found - library build may be disabled') + # ulib is not yet supported with clang + if ubman.config.buildconfig.get('config_cc_is_clang'): + pytest.skip('ulib not supported with clang') + + assert os.path.exists(test_program), 'ulib_test not found in build dir' # Build the demo programs - clean first to ensure fresh build, since this # test is run in the source directory @@ -148,9 +155,11 @@ def test_ulib_rust_demos(ubman): examples = os.path.join(src, 'examples', 'rust') test_program = os.path.join(build, 'test', 'ulib', 'ulib_test') - # Skip test if ulib_test doesn't exist (clang) - if not os.path.exists(test_program): - pytest.skip('ulib_test not found - library build may be disabled') + # ulib is not yet supported with clang + if ubman.config.buildconfig.get('config_cc_is_clang'): + pytest.skip('ulib not supported with clang') + + assert os.path.exists(test_program), 'ulib_test not found in build dir' # Check if cargo is available try: @@ -183,9 +192,11 @@ def test_ulib_api_header(ubman): hdr = os.path.join(ubman.config.build_dir, 'include', 'u-boot-api.h') - # Skip if header doesn't exist (clang) - if not os.path.exists(hdr): - pytest.skip('u-boot-api.h not found - library build may be disabled') + # ulib is not yet supported with clang + if ubman.config.buildconfig.get('config_cc_is_clang'): + pytest.skip('ulib not supported with clang') + + assert os.path.exists(hdr), 'u-boot-api.h not found in build directory' # Read and verify header content with open(hdr, 'r', encoding='utf-8') as inf: