Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 321F1C433EF for ; Tue, 12 Jul 2022 01:05:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8CE1D840E8; Tue, 12 Jul 2022 03:05:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="APSfhyoW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0F573840AF; Tue, 12 Jul 2022 03:04:48 +0200 (CEST) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CEE8B8409C for ; Tue, 12 Jul 2022 03:04:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-wr1-x436.google.com with SMTP id f2so9088304wrr.6 for ; Mon, 11 Jul 2022 18:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gpRdlL8IGsTQW8YST4+LxR9tQnoS0dRfaV3YWjhDUf0=; b=APSfhyoWWK6/SLuhVdB7N3O4mvHYTig3Sx1imUwXbvoUohlXz/qPZ+3PLdXVNazzJG 22N6MUO6v3yWvo9C6pCQ4sVTy0AoF6A9akms9eKDGYJKMBEqOe77OTNa6utitF7HH1Aj goiG4XOi4y9nOnzKpnja0fXu5FapilaHiUls8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gpRdlL8IGsTQW8YST4+LxR9tQnoS0dRfaV3YWjhDUf0=; b=3KPl/8ZLF4mwLoXuTPG74V5iqMhm40HFiF5QndCU6wbeajo/h7xBWZ4/DgE3G6aO9l Ry0LiYX5DiM83tLy2HFaG4x0v57YHMeKIaYQjNhRDk2DLCRMvbYwaiVqmbU6UqkcBAeT w7cqI6JyiFwAz+pe4cu/miNL/s3ooyoYxyOHHSM8KPlVjmmjtWWpP2pbq4V432Cf3YWE oRlGdSSr02s/UOftjkDENMB5YJylPMFHIT4dygToKhGtshlNPOgRB0az7K8e1E/JMpPh 2et+5G7JXjOwAryLp0lcOuM4FHe6JwJDlyVlBIHF3iA3q6dFXqSaS584IUEIQH4jLn7J asDA== X-Gm-Message-State: AJIora9NFFw5nQeinuVfg3SWdqFIYlPvyqmnmQ7n+6aYAXs4HFyU2I9w Rl7Vdmpacuggf5u7b8aq/kF+Igl4i5/5wZEW X-Google-Smtp-Source: AGRyM1v7e//aXxEikczPy+8UWdMAYsJvSLX7tnk21I8lfgV12NeFr3Em43waoF4s+wVnUvl0dgXJ9Q== X-Received: by 2002:adf:d1c9:0:b0:20f:c3dc:e980 with SMTP id b9-20020adfd1c9000000b0020fc3dce980mr19133462wrd.552.1657587878097; Mon, 11 Jul 2022 18:04:38 -0700 (PDT) Received: from sjg1.roam.corp.google.com (host-92-0-109-232.as13285.net. [92.0.109.232]) by smtp.gmail.com with ESMTPSA id p12-20020a5d48cc000000b0021d9d13bf6csm5541152wrs.97.2022.07.11.18.04.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 18:04:37 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 05/19] buildman: Fix use of 'boards' in test Date: Mon, 11 Jul 2022 19:03:59 -0600 Message-Id: <20220712010413.331984-6-sjg@chromium.org> X-Mailer: git-send-email 2.37.0.144.g8ac04bfd2-goog In-Reply-To: <20220712010413.331984-1-sjg@chromium.org> References: <20220712010413.331984-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean We want to create a module called 'boards' so avoid use of this variable name in this module. Change the global to be capitalised, as required by Python style. Signed-off-by: Simon Glass --- tools/buildman/test.py | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/tools/buildman/test.py b/tools/buildman/test.py index 62ad25db397..6c09cb7fad5 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -94,7 +94,7 @@ commits = [ [errors[4]]], ] -boards = [ +BOARDS = [ ['Active', 'arm', 'armv7', '', 'Tester', 'ARM Board 1', 'board0', ''], ['Active', 'arm', 'armv7', '', 'Tester', 'ARM Board 2', 'board1', ''], ['Active', 'powerpc', 'powerpc', '', 'Tester', 'PowerPC board 1', 'board2', ''], @@ -131,10 +131,10 @@ class TestBuild(unittest.TestCase): self.commits.append(comm) # Set up boards to build - self.boards = board.Boards() - for brd in boards: - self.boards.AddBoard(board.Board(*brd)) - self.boards.SelectBoards([]) + self.brds = board.Boards() + for brd in BOARDS: + self.brds.AddBoard(board.Board(*brd)) + self.brds.SelectBoards([]) # Add some test settings bsettings.Setup(None) @@ -176,7 +176,7 @@ class TestBuild(unittest.TestCase): result.combined = result.stdout + result.stderr return result - def assertSummary(self, text, arch, plus, boards, outcome=OUTCOME_ERR): + def assertSummary(self, text, arch, plus, brds, outcome=OUTCOME_ERR): col = self._col expected_colour = (col.GREEN if outcome == OUTCOME_OK else col.YELLOW if outcome == OUTCOME_WARN else col.RED) @@ -184,7 +184,7 @@ class TestBuild(unittest.TestCase): # TODO(sjg@chromium.org): If plus is '', we shouldn't need this expect += ' ' + col.build(expected_colour, plus) expect += ' ' - for brd in boards: + for brd in brds: expect += col.build(expected_colour, ' %s' % brd) self.assertEqual(text, expect) @@ -203,7 +203,7 @@ class TestBuild(unittest.TestCase): build = builder.Builder(self.toolchains, self.base_dir, None, threads, 2, checkout=False, show_unknown=False) build.do_make = self.Make - board_selected = self.boards.GetSelectedDict() + board_selected = self.brds.GetSelectedDict() # Build the boards for the pre-defined commits and warnings/errors # associated with each. This calls our Make() to inject the fake output. @@ -217,7 +217,7 @@ class TestBuild(unittest.TestCase): # We should get two starting messages, an update for every commit built # and a summary message - self.assertEqual(count, len(commits) * len(boards) + 3) + self.assertEqual(count, len(commits) * len(BOARDS) + 3) build.SetDisplayOptions(**kwdisplay_args); build.ShowSummary(self.commits, board_selected) if echo_lines: @@ -236,7 +236,7 @@ class TestBuild(unittest.TestCase): filter_dtb_warnings: Adjust the check for output produced with the --filter-dtb-warnings flag """ - def add_line_prefix(prefix, boards, error_str, colour): + def add_line_prefix(prefix, brds, error_str, colour): """Add a prefix to each line of a string The training \n in error_str is removed before processing @@ -253,9 +253,9 @@ class TestBuild(unittest.TestCase): lines = error_str.strip().splitlines() new_lines = [] for line in lines: - if boards: + if brds: expect = self._col.build(colour, prefix + '(') - expect += self._col.build(self._col.MAGENTA, boards, + expect += self._col.build(self._col.MAGENTA, brds, bright=False) expect += self._col.build(colour, ') %s' % line) else: @@ -468,18 +468,18 @@ class TestBuild(unittest.TestCase): def testBoardSingle(self): """Test single board selection""" - self.assertEqual(self.boards.SelectBoards(['sandbox']), + self.assertEqual(self.brds.SelectBoards(['sandbox']), ({'all': ['board4'], 'sandbox': ['board4']}, [])) def testBoardArch(self): """Test single board selection""" - self.assertEqual(self.boards.SelectBoards(['arm']), + self.assertEqual(self.brds.SelectBoards(['arm']), ({'all': ['board0', 'board1'], 'arm': ['board0', 'board1']}, [])) def testBoardArchSingle(self): """Test single board selection""" - self.assertEqual(self.boards.SelectBoards(['arm sandbox']), + self.assertEqual(self.brds.SelectBoards(['arm sandbox']), ({'sandbox': ['board4'], 'all': ['board0', 'board1', 'board4'], 'arm': ['board0', 'board1']}, [])) @@ -487,20 +487,20 @@ class TestBuild(unittest.TestCase): def testBoardArchSingleMultiWord(self): """Test single board selection""" - self.assertEqual(self.boards.SelectBoards(['arm', 'sandbox']), + self.assertEqual(self.brds.SelectBoards(['arm', 'sandbox']), ({'sandbox': ['board4'], 'all': ['board0', 'board1', 'board4'], 'arm': ['board0', 'board1']}, [])) def testBoardSingleAnd(self): """Test single board selection""" - self.assertEqual(self.boards.SelectBoards(['Tester & arm']), + self.assertEqual(self.brds.SelectBoards(['Tester & arm']), ({'Tester&arm': ['board0', 'board1'], 'all': ['board0', 'board1']}, [])) def testBoardTwoAnd(self): """Test single board selection""" - self.assertEqual(self.boards.SelectBoards(['Tester', '&', 'arm', + self.assertEqual(self.brds.SelectBoards(['Tester', '&', 'arm', 'Tester' '&', 'powerpc', 'sandbox']), ({'sandbox': ['board4'], @@ -511,19 +511,19 @@ class TestBuild(unittest.TestCase): def testBoardAll(self): """Test single board selection""" - self.assertEqual(self.boards.SelectBoards([]), + self.assertEqual(self.brds.SelectBoards([]), ({'all': ['board0', 'board1', 'board2', 'board3', 'board4']}, [])) def testBoardRegularExpression(self): """Test single board selection""" - self.assertEqual(self.boards.SelectBoards(['T.*r&^Po']), + self.assertEqual(self.brds.SelectBoards(['T.*r&^Po']), ({'all': ['board2', 'board3'], 'T.*r&^Po': ['board2', 'board3']}, [])) def testBoardDuplicate(self): """Test single board selection""" - self.assertEqual(self.boards.SelectBoards(['sandbox sandbox', + self.assertEqual(self.brds.SelectBoards(['sandbox sandbox', 'sandbox']), ({'all': ['board4'], 'sandbox': ['board4']}, [])) def CheckDirs(self, build, dirname): -- 2.37.0.144.g8ac04bfd2-goog