From patchwork Mon Jan 12 22:54:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1488 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=1768258470; bh=KpcY4BBiZZyQSYnK8jVcMgyTPwuVIsjVP4eJ/OAYyrQ=; 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=toosMIxAMLu0G/tsCp8MDWVn3DNxqpm0s+IiW/A5O4hxGH4za9/Cv3qoivPrD++Rt 8r8B8GcvqvX3yihf/4AqgxMvmXOMH3f+7t0fDySQU/wCVB+elm9QNILjclHt9vafbx rTKtQVWle+t7KrQURWbJUXjTNwHkH0lrayD7WRZYbndFnz41Dc+Oj8yMy/s4KEGYBt 90lcy1qhvWoeVloQ7pLc90iEzRDNxzYKQQr+tOzIdJufQTDFiqolpunUjaAXCPYEcr iFIKWkR0j1nhANSpZLWJ5K2dzUdovIKDKaOBOSqWVkloyINcf8oKcvHJK1DK2Kllue piOzThGlMm1RA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4BAE9692FE for ; Mon, 12 Jan 2026 15:54:30 -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 RLfrP1nu3U1a for ; Mon, 12 Jan 2026 15:54:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768258470; bh=KpcY4BBiZZyQSYnK8jVcMgyTPwuVIsjVP4eJ/OAYyrQ=; 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=toosMIxAMLu0G/tsCp8MDWVn3DNxqpm0s+IiW/A5O4hxGH4za9/Cv3qoivPrD++Rt 8r8B8GcvqvX3yihf/4AqgxMvmXOMH3f+7t0fDySQU/wCVB+elm9QNILjclHt9vafbx rTKtQVWle+t7KrQURWbJUXjTNwHkH0lrayD7WRZYbndFnz41Dc+Oj8yMy/s4KEGYBt 90lcy1qhvWoeVloQ7pLc90iEzRDNxzYKQQr+tOzIdJufQTDFiqolpunUjaAXCPYEcr iFIKWkR0j1nhANSpZLWJ5K2dzUdovIKDKaOBOSqWVkloyINcf8oKcvHJK1DK2Kllue piOzThGlMm1RA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3B16A692F5 for ; Mon, 12 Jan 2026 15:54:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768258469; bh=Gp7QWkzvb1oC6MrZkbYboyslyX2VI0F0kUE9G+Jwqfo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DN9B2Rssd/JTQwcI/40YZbqkO4iZTlU9ohuhy6lQY7X/QuwX7BXMYOZTFWhccTQp+ 0IvwShLqxIJyNgOreNEwb2m4+2v91iesabE3rVAUvUrB4yXGGO3um4NOcQQgnPPuDI rJou7qsSZg1uc8uh9vxhRJZlike6bAq5AZanOKUjo3SEXWQQukCDJyoqSicwCDpEWs EM24olh8I353hW5/H+DmMAygvtupjkP+94DV1Z1CsMtPBpyGykvG4Qp82ec7Kx2bo/ vsXlle45JeIF9U+E7YvRQjx+sgHGK0FrB62nWMSflRyTdYLiburhpYcOEBk6++Lnum XhSWpSkjQSxjA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 34F53692F5; Mon, 12 Jan 2026 15:54:29 -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 rx2QCIjuX7G1; Mon, 12 Jan 2026 15:54:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768258464; bh=g+L+l5+iWfhzNK2Q1ZnN9xsFjPAYlphJ7r+PcaoWVAU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g/5UoQC5Mrc2FnYspa6GqAcS3+H4/7+Hc3KgfxUDZRbTJ09z4GfMUWnLUWWcPlugy tA+1CsBURzM1I1QoV7dgYg6mxiUQIwnLlJ4zTRdP7JCaoaQ8TwlFv+G6yqfgXufbQ2 7f9UJ60Kd4UwXl/ZyJnlauFHz0ZfCsm0B7WYs92O7ZaPUIkDqS7JWENbJ2UEh0FHNi QXye8xEfZtKgVFcvEqZjVar8H3NbjM1DqSFkxo4CohTSvJLkru5nl8EfSD70tNT/Sy pVrwW8IoHxpvmVcWnDTqG/EafOUwuTJPGMy/1NdCl32Crxx73zSeVdsk2wK19WKu7M xTysYHRLiknoQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E9F1C6913F; Mon, 12 Jan 2026 15:54:23 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 12 Jan 2026 15:54:00 -0700 Message-ID: <20260112225406.3274105-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260112225406.3274105-1-sjg@u-boot.org> References: <20260112225406.3274105-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: CCVEWT6LOUYCWZ6DTSEWEVM2L67CHQ67 X-Message-ID-Hash: CCVEWT6LOUYCWZ6DTSEWEVM2L67CHQ67 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 2/5] buildman: Add a board parameter to check_command() 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 check_command() helper function hardcodes 'board0' for the output directory path. Add a board parameter to make the function more explicit about which board is being tested. Update all callers to pass 'board0' as the first argument. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/func_test.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index ec2b2efc3b6..7f4c88701bb 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -1048,23 +1048,26 @@ Idx Name Size VMA LMA File off Algn self.assertEqual(False, control.get_allow_missing(False, True, 2, True)) - def check_command(self, *extra_args): + def check_command(self, brd, *extra_args): """Run a command with the extra arguments and return the commands used Args: + brd (str): Board name to build extra_args (list of str): List of extra arguments Returns: - list of str: Lines returned in the out-cmd file + tuple: + list of str: Lines returned in the out-cmd file + bytes: Contents of .config file """ - self._run_control('-o', self._output_dir, *extra_args) - board0_dir = os.path.join(self._output_dir, 'current', 'board0') - self.assertTrue(os.path.exists(os.path.join(board0_dir, 'done'))) - cmd_fname = os.path.join(board0_dir, 'out-cmd') + self._run_control('-o', self._output_dir, brd, *extra_args) + board_dir = os.path.join(self._output_dir, 'current', brd) + self.assertTrue(os.path.exists(os.path.join(board_dir, 'done'))) + cmd_fname = os.path.join(board_dir, 'out-cmd') self.assertTrue(os.path.exists(cmd_fname)) data = tools.read_file(cmd_fname) - config_fname = os.path.join(board0_dir, '.config') + config_fname = os.path.join(board_dir, '.config') self.assertTrue(os.path.exists(config_fname)) cfg_data = tools.read_file(config_fname) @@ -1072,14 +1075,14 @@ Idx Name Size VMA LMA File off Algn def test_cmd_file(self): """Test that the -cmd-out file is produced""" - lines = self.check_command()[0] + lines = self.check_command('board0')[0] self.assertEqual(2, len(lines)) self.assertRegex(lines[0], b'make O=/.*board0_defconfig') self.assertRegex(lines[0], b'make O=/.*-s.*') def test_no_lto(self): """Test that the --no-lto flag works""" - lines = self.check_command('-L')[0] + lines = self.check_command('board0', '-L')[0] self.assertIn(b'NO_LTO=1', lines[0]) def test_fragments(self): @@ -1110,7 +1113,8 @@ Idx Name Size VMA LMA File off Algn ''', cfg_data) with terminal.capture() as (stdout, _stderr): - lines, cfg_data = self.check_command('-r', '-a', 'LOCALVERSION') + lines, cfg_data = self.check_command('board0', '-r', '-a', + 'LOCALVERSION') self.assertIn(b'SOURCE_DATE_EPOCH=0', lines[0]) # We should see CONFIG_LOCALVERSION_AUTO unset @@ -1456,7 +1460,7 @@ CONFIG_SOC="fred" def test_target(self): """Test that the --target flag works""" - lines = self.check_command('--target', 'u-boot.dtb')[0] + lines = self.check_command('board0', '--target', 'u-boot.dtb')[0] # It should not affect the defconfig line self.assertNotIn(b'u-boot.dtb', lines[0])