From patchwork Fri Jan 9 18:31:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1387 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=1767983538; bh=wTdRoWMAPcRyIL1BR7hGbGzFeS7aakvc1OMulSA7o88=; 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=kZjg+VFx63QUfEwU8DBwev/AW0rG3u5pYpcE+etCMkPRV7LEiCU652h+lL9MtnApu 7eR0nARvvTRc+GzMrbZ3XJdw+dLbyoD3hq63JNckYs0jJ5pvnWPte8vCzt+JoHAQ64 8ojJ00R8yIGFnfx3SzwhYcYhmjHHRpfGbFsuZTujLUGyRHwc/GbMHzOaLdqKdZJoy/ wXFy2dKkAA/8hzPK5a+CbCpDnkTboIEfGDiDYiki9PihWN09LBCNH+XjoNZTrSw1pS YRlr9B+wv+GicOo1IkJFHrSIU+C16rQaS+uIEFs0H9fj9NRnDOVU20Yb5PTFGNd7kT 6NoffIzioEhvA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0756569211 for ; Fri, 9 Jan 2026 11:32:18 -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 5lKe-BJ9dpmk for ; Fri, 9 Jan 2026 11:32:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767983537; bh=wTdRoWMAPcRyIL1BR7hGbGzFeS7aakvc1OMulSA7o88=; 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=FDRz77Vfahd1QvAB4lnk/3fOUdVX6KSOkelLY5TF8GnNRDkjQJxdz3X3aRfnF57US D5Pozbf4/tgu+F7SujLkYXGLhTG4bEhoqxjQHm0pYhYauAYjJHjQqP6yaqf8BKKtDS qkIhjCJ1o7VBx2T0TGXTyBr5qvmlF8BFTlVFxm4hB1lXHqbrqR++fxSZcTelCgiJ8u u85e0WlMipQtTaEATXyvK2wfqsO7SARbeKgmbqCbGxho0xsMGCkUr/HO7+2HSe8rCa dBHqrKKn+NM6tP95HPTb3XQhHmfudLKDTX1fQMPx8odGleJmBRpEyW4uJeEHMjqVGS 341n9sk3TuRvg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E572969216 for ; Fri, 9 Jan 2026 11:32:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767983535; bh=TgCUXLePpt8vK5eAskKNwbSulTVv8M9M+tx10Z8Iglk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m3Ev7ImPbioZJ2HnxwXIEMafBxjTxeimEn6Z+ZcnW1KFKoeRZdBCjzhFBnocVbVT9 MBOICysoJrhdHiNkAMlAywZn5OFwG5aKfb8G+aEu6EtLNt4C+rj/gtdhLXrBUVKc9+ iSgMDD9+QNnnAdy8pS8vJup+b0n8F7vxu3RcAgoIBSEvqQXOUiTBrA964lEqjcJq/i t1k7zUxxRznH26gwgdqooYryFxx9EBLDopiwNAx2y5RgjalpvbtYh4CQeDPdHnk0gq Y0IpDJdPFYxvwOp0nPU1rEDYr8UzJBwQiPIH2aeStvIGsb52zMTZ3lR4ZykmxpboTQ v1EEgx/bU+SeA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5C19D69218; Fri, 9 Jan 2026 11:32:15 -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 Ufu102O_FrbL; Fri, 9 Jan 2026 11:32:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1767983530; bh=N/apnc4BbdkXVDlnnsDj5u1AIIjxsdc38aMfqpNJF70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w2BRRGkhFMBKMrHx/6VAoqC7uH1eByJdN7sDjIOMecrWDUPl/hUsqxe9MyHYeMqzg 4JUnUZJrPEQvupeNrQNjRgPYX81w43mrisxEv9Se9QqOM0cBEsE+AxsZguNBqrzGyT L3irL/xkLg/qC9qSAg1QnpErAy+/eshpi/OF3US2dhFlwfxueAF78+p+oUu1fpfOtu 6ViW7PGi63iSO/TNVpRDwzQhgA+RVcAIigP+TPfkrEN4uzCs2mgFGUlq3ORMoDRkKP YRaWNzr7z7K098leRDsTn/2TlF1QWKjk0rTKxYCiC2ixNvs2XZKlThPCeULKxuHAW4 ftqBJHOmY7fVw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 528156920A; Fri, 9 Jan 2026 11:32:10 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Fri, 9 Jan 2026 11:31:01 -0700 Message-ID: <20260109183116.3262115-10-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: XRQPEFZ2TYPOS6G4G6S6E4JPHLVE7EQ6 X-Message-ID-Hash: XRQPEFZ2TYPOS6G4G6S6E4JPHLVE7EQ6 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 09/18] buildman: Add test for IDE mode output 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 testCurrentSourceIde() to verify that IDE mode (-I flag) correctly outputs build errors to stderr and suppresses progress output to stdout. Also update _HandleMake() to support error injection for current source builds where the commit parameter is the string 'current'. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/func_test.py | 74 +++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index 0ee52d16703..efd66796a65 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -525,6 +525,9 @@ Some images are invalid''' stderr = "binman: Filename 'fsp.bin' not found in input path" elif type(commit) is not str: stderr = self._error.get((brd.target, commit.sequence)) + else: + # For current source builds, commit is 'current' + stderr = self._error.get((brd.target, commit)) if stderr: return command.CommandResult(return_code=2, stderr=stderr) @@ -593,6 +596,77 @@ Some images are invalid''' self.assertEqual(self._builder.count, self._total_builds) self.assertEqual(self._builder.fail, 0) + def testCurrentSourceIde(self): + """Test building current source with IDE mode enabled + + This tests that: + - Build errors are written to stderr + - Progress output does not go to stdout in IDE mode + - Summary mode (-s) shows output again + """ + # Set up a build error for sandbox board (board4) which has toolchain + # For current source builds, commit is 'current' string + error_msg = 'test_error_msg.c:123: error: test failure\n' + self._error['board4', 'current'] = error_msg + + # Capture stderr during the build + captured_stderr = io.StringIO() + old_stderr = sys.stderr + try: + sys.stderr = captured_stderr + terminal.get_print_test_lines() # Clear any previous output + self._RunControl('-o', self._output_dir, '-I') + finally: + sys.stderr = old_stderr + + # Verify there is a build failure + self.assertEqual(self._builder.fail, 1) + + # Check stderr has exactly the expected error + self.assertEqual(captured_stderr.getvalue(), + 'test_error_msg.c:123: error: test failure\n') + + # In IDE mode, there should be no stdout output at all + self.assertEqual(terminal.get_print_test_lines(), []) + + # Now run with -s to show summary - output should appear again + terminal.get_print_test_lines() # Clear + self._RunControl('-o', self._output_dir, '-s', clean_dir=False) + lines = terminal.get_print_test_lines() + self.assertEqual(len(lines), 2) + self.assertIn('Summary of', lines[0].text) + self.assertIn('board4', lines[1].text) + + def testBranchIde(self): + """Test building a branch with IDE mode and summary + + This tests _print_ide_output() which outputs errors to stderr during + the summary phase for branch builds. + """ + # Set up error for commit 1 on sandbox board + error_msg = 'branch_error.c:456: error: branch failure\n' + self._error['board4', 1] = error_msg + + # Build branch normally first (writes results to disk) + terminal.get_print_test_lines() + self._RunControl('-b', TEST_BRANCH, '-o', self._output_dir) + self.assertEqual(self._builder.fail, 1) + + # Run summary with IDE mode - errors go to stderr via _print_ide_output + captured_stderr = io.StringIO() + old_stderr = sys.stderr + try: + sys.stderr = captured_stderr + terminal.get_print_test_lines() + self._RunControl('-b', TEST_BRANCH, '-o', self._output_dir, '-sI', + clean_dir=False) + finally: + sys.stderr = old_stderr + + # Check stderr has the error from _print_ide_output + self.assertEqual(captured_stderr.getvalue(), + 'branch_error.c:456: error: branch failure\n') + def testBranchSummary(self): """Test building a branch and then showing a summary""" self._RunControl('-b', TEST_BRANCH, '-o', self._output_dir)