From patchwork Fri Jan 9 18:30:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1383 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=1767983518; bh=eKFfwJ0ObxbcFaDqo9XsVyIQYIFVJxMRUiLSjEKTJTw=; 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=dp8Ju5x2k51De05sRvzhuItxfcjD1tvfwYsZHDAnuZbLvYciLTY0JL0irJ2mJUK+p /ouN4yOIMcBRWPFce94UhkjJ2gTx1/73ZZkJETxR7ED0LOwrEADEUGoIzdRMN5xEl8 DPD3K+WCV03LtUprRbjap1bj2/E1gR6eioN5+4bQKkA4Kr5Ew+SrtDqdr/45F0hh0N /f5lcnaFJExd83dfbuyWfJkAh4AWIRcbNvnfNI2XvATAAU/AxkccEz8X6RG3YSOuf1 I2q1Cuex7NV2OpJ4UvF+3V/1l3VFihmFCpdoe7hyDQTaubNqpfBrJQpVo0ySrRWrPg sA2KibCZOMVZA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2B2A069216 for ; Fri, 9 Jan 2026 11:31:58 -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 hnlYOquk_Mgb for ; Fri, 9 Jan 2026 11:31:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767983518; bh=eKFfwJ0ObxbcFaDqo9XsVyIQYIFVJxMRUiLSjEKTJTw=; 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=dp8Ju5x2k51De05sRvzhuItxfcjD1tvfwYsZHDAnuZbLvYciLTY0JL0irJ2mJUK+p /ouN4yOIMcBRWPFce94UhkjJ2gTx1/73ZZkJETxR7ED0LOwrEADEUGoIzdRMN5xEl8 DPD3K+WCV03LtUprRbjap1bj2/E1gR6eioN5+4bQKkA4Kr5Ew+SrtDqdr/45F0hh0N /f5lcnaFJExd83dfbuyWfJkAh4AWIRcbNvnfNI2XvATAAU/AxkccEz8X6RG3YSOuf1 I2q1Cuex7NV2OpJ4UvF+3V/1l3VFihmFCpdoe7hyDQTaubNqpfBrJQpVo0ySrRWrPg sA2KibCZOMVZA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1AAF369208 for ; Fri, 9 Jan 2026 11:31:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767983516; bh=hgeeCrbn+lPMbNyJs9vTRYi4inqVai1L/ZN9t18uhCY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WWT5cEfknHoYTX1eII6mouoiWg26ksO53OE2nznnOwv3fTzFa3pQyPAk79/JEpmlr 93GccMB96JD/6VaeP6bSGCCcBmLx32Cqv7rpp7NzwRXKeSDkbA/Mwx30mo2EeiWwtA S0jcBs4BNLNEKcjbGX2qB1A+CJueWo4vw28sW/MJ863dq//h99zuqNBTPB/Q8rm9Xq D6YsIq8W4HfSB2+ZMNWnQLQoG24qYZX8QNomvWKO2PMMKxUyVf/+9ooxQn0P435s/y HgeZhmXu1cqgU7U6uSpFd2LVgrl/KPthu9aRo8KZX6c7BIQRzyN8qdjo0r/ehk46mV O/gFPSzHqjW6g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2BF5069208; Fri, 9 Jan 2026 11:31:56 -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 XBLX1WEfn8IZ; Fri, 9 Jan 2026 11:31:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767983512; bh=BlmiCkJZYYWalLR4ATOlJoXHTmXCazFh0NEa1sxgTJs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q55IU2EzNi9aoUd4latl/XCRF1erZmitCR/NGwxPDBdXhDQyT7An6FY89urCU+ZAv Rs+muHPE69T6A8MlVtqUnYpaRIaiGCGCpuxXtqsyFOBjPBVi/ln2YI03SGWllk5hQH uIbjS1CyBM8M20dbkYdGDrGNqWsqfkV/kAmBJtaN7IY8jymOBXS5BQ8h9G4W1zanuF HSSVEjnzcy9JVy3uWLS8IoL+kcvdvO6E71pwIgp+Wx4dYe2gcO7LOeS532wUK5EjQQ StKydmduD5Ogtiq5OCXdWf/jhkXpLEl0lmh6lT0zhMVnBRJByDCUcdmjHki9YDIKYF dC7bu0dwWfhtw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A880069209; Fri, 9 Jan 2026 11:31:51 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Fri, 9 Jan 2026 11:30:57 -0700 Message-ID: <20260109183116.3262115-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260109183116.3262115-1-sjg@u-boot.org> References: <20260109183116.3262115-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 3DV3OCGIGTW6XHO2D6QJBMPWK5FHFJE4 X-Message-ID-Hash: 3DV3OCGIGTW6XHO2D6QJBMPWK5FHFJE4 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: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 05/18] buildman: Add test for -K flag (show config changes) 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 Extend testBranchSummary() to test the -K flag which shows configuration-changes between commits. Create u-boot.cfg files with varying content in each commit's output directory to simulate config changes. This significantly improves coverage of the config change display code in builder.py including _show_config_changes(), _calc_config_changes(), and _print_arch_config_summary() Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/func_test.py | 39 ++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index 69f6b25fa5a..817cd6e7a7f 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -490,7 +490,18 @@ Idx Name Size VMA LMA File off Algn return command.CommandResult(return_code=0) elif stage == 'config': fname = os.path.join(cwd or '', out_dir, '.config') - tools.write_file(fname, b'CONFIG_SOMETHING=1') + # Vary config based on commit to simulate config changes + seq = commit.sequence if hasattr(commit, 'sequence') else 0 + config = f'CONFIG_SOMETHING={seq + 1}\n' + if seq > 0: + config += 'CONFIG_NEW_OPTION=y\n' + tools.write_file(fname, config.encode('utf-8')) + # Also create u-boot.cfg which buildman reads for -K flag + cfg_fname = os.path.join(cwd or '', out_dir, 'u-boot.cfg') + cfg_content = f'#define CONFIG_VALUE {seq + 100}\n' + if seq > 0: + cfg_content += '#define CONFIG_EXTRA 1\n' + tools.write_file(cfg_fname, cfg_content.encode('utf-8')) return command.CommandResult(return_code=0, combined='Test configuration complete') elif stage == 'oldconfig': @@ -618,6 +629,32 @@ Some images are invalid''' self.assertIn('board_init', text) self.assertIn('(no errors to report)', lines[-1].text) + # Now run with -K to show config changes + # First, create config files in the output directory to simulate + # varying configs between commits. Use the builder to get correct paths. + for commit_num in range(self._commits): + for brd in BOARDS: + target = brd[6] # target name is 7th element + board_dir = self._builder.get_build_dir(commit_num, target) + cfg_fname = os.path.join(board_dir, 'u-boot.cfg') + cfg_content = f'#define CONFIG_VALUE {commit_num + 100}\n' + if commit_num == 0: + # Add a config that will be removed in later commits + cfg_content += '#define CONFIG_OLD_OPTION 1\n' + if commit_num > 0: + cfg_content += '#define CONFIG_NEW_OPTION 1\n' + tools.write_file(cfg_fname, cfg_content.encode('utf-8')) + + self._make_calls = 0 + self._RunControl('-b', TEST_BRANCH, '-sK', '-o', self._output_dir, + clean_dir=False) + self.assertEqual(self._make_calls, 0) + lines = terminal.get_print_test_lines() + text = '\n'.join(line.text for line in lines) + # Check config options appear in the output + self.assertIn('CONFIG_', text) + self.assertIn('(no errors to report)', lines[-1].text) + def testCount(self): """Test building a specific number of commitst""" self._RunControl('-b', TEST_BRANCH, '-c2', '-o', self._output_dir)