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 B2C0BC43334 for ; Tue, 12 Jul 2022 01:05:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4D526840B9; Tue, 12 Jul 2022 03:05:01 +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="Ydd9kuVp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E1410840AF; Tue, 12 Jul 2022 03:04:45 +0200 (CEST) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 A1E1E840A5 for ; Tue, 12 Jul 2022 03:04:37 +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-x429.google.com with SMTP id q9so9093317wrd.8 for ; Mon, 11 Jul 2022 18:04:37 -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=LwRYeOBgi7wRj9NTN6fR1WA5a5UY4j+sMTMy7C77vCI=; b=Ydd9kuVp+EQDwbKiHb05j7ocwvyLx2NbvygYpXIIsgVXlujdAsg4t2XFIBXkEduuMw 906EvBgh7gWvSgDhalzONZCCtCqnHd7f9tXwaTBfrXFpMENjhQfZOiVGVYq0SfGqY5/U 99aEDzsEjgW/O6katSHBBGk+Ke62wqdGGszR8= 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=LwRYeOBgi7wRj9NTN6fR1WA5a5UY4j+sMTMy7C77vCI=; b=AlVzLYov/exoK4WvIvyMWII23O2Ls+QKEMsLOW6Lzjhum2d3ThopksrhGXItVjLOT5 YRDJmvB+hDl1k0r4Cf/HIUC+IJ8czXD+kCACBQY4m1Cgm+l/F0Ci4I/LiDaKy3UU7QHF DAyh0IMg8Bp2ASZC26bsSLHmEr23en3WH/JdLxvoor780F+aNxtYGHYVeyKwxicZxpCg 1AMjS4FIZwCqv6JeCWBYtwnzahbvSC6mV1zQqjiu5NcbYPojrgUVjMQwvjPXPAbvtVNn TaaArACWm8nGnH1jnQDZXcpSoZ+HYea4lIJy601ls01O2hc9meTwJZ2iY6HuOyM8KWhD 6EOg== X-Gm-Message-State: AJIora+8Ubya7EFdn7J0SBmLQUtrzZGpWDrQpJX+Lazj71T1OJociCpI FCPqWY5Y6ScmXqk8TFzUIDxkwSxQYuQ8tGIJ X-Google-Smtp-Source: AGRyM1tWm9xeMQMMklLsbNRnLCRkEVrfnG5xYDD/Qw2Rb9Zt4ySTABrBNIpvI+KTCeETSDyy/BNK2g== X-Received: by 2002:a5d:4b87:0:b0:21d:7019:80c6 with SMTP id b7-20020a5d4b87000000b0021d701980c6mr18949345wrt.234.1657587877103; Mon, 11 Jul 2022 18:04:37 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jul 2022 18:04:36 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass Subject: [PATCH 04/19] buildman: Fix use of 'boards' in func_test Date: Mon, 11 Jul 2022 19:03:58 -0600 Message-Id: <20220712010413.331984-5-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/func_test.py | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index 0265286908d..812dc924c8d 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -35,7 +35,7 @@ chromeos_daisy=VBOOT=${chroot}/build/daisy/usr ${vboot} chromeos_peach=VBOOT=${chroot}/build/peach_pit/usr ${vboot} ''' -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', ''], @@ -188,13 +188,13 @@ class TestFunctional(unittest.TestCase): self._toolchains.Add('arm-gcc', test=False) self._toolchains.Add('powerpc-gcc', test=False) self._boards = board.Boards() - for brd in boards: + for brd in BOARDS: self._boards.AddBoard(board.Board(*brd)) # Directories where the source been cloned self._clone_dirs = [] self._commits = len(commit_shortlog.splitlines()) + 1 - self._total_builds = self._commits * len(boards) + self._total_builds = self._commits * len(BOARDS) # Number of calls to make self._make_calls = 0 @@ -220,13 +220,13 @@ class TestFunctional(unittest.TestCase): return command.run_pipe([[self._buildman_pathname] + list(args)], capture=True, capture_stderr=True) - def _RunControl(self, *args, boards=None, clean_dir=False, + def _RunControl(self, *args, brds=None, clean_dir=False, test_thread_exceptions=False): """Run buildman Args: args: List of arguments to pass - boards: + brds: Boards object clean_dir: Used for tests only, indicates that the existing output_dir should be removed before starting the build test_thread_exceptions: Uses for tests only, True to make the threads @@ -239,7 +239,7 @@ class TestFunctional(unittest.TestCase): sys.argv = [sys.argv[0]] + list(args) options, args = cmdline.ParseArgs() result = control.DoBuildman(options, args, toolchains=self._toolchains, - make_func=self._HandleMake, boards=boards or self._boards, + make_func=self._HandleMake, boards=brds or self._boards, clean_dir=clean_dir, test_thread_exceptions=test_thread_exceptions) self._builder = control.builder @@ -451,7 +451,7 @@ class TestFunctional(unittest.TestCase): self.setupToolchains(); self._RunControl('-o', self._output_dir) lines = terminal.get_print_test_lines() - self.assertIn('Building current source for %d boards' % len(boards), + self.assertIn('Building current source for %d boards' % len(BOARDS), lines[0].text) def testBadBranch(self): @@ -467,7 +467,7 @@ class TestFunctional(unittest.TestCase): # Buildman always builds the upstream commit as well self.assertIn('Building %d commits for %d boards' % - (self._commits, len(boards)), lines[0].text) + (self._commits, len(BOARDS)), lines[0].text) self.assertEqual(self._builder.count, self._total_builds) # Only sandbox should succeed, the others don't have toolchains @@ -493,17 +493,17 @@ class TestFunctional(unittest.TestCase): def testCount(self): """Test building a specific number of commitst""" self._RunControl('-b', TEST_BRANCH, '-c2', '-o', self._output_dir) - self.assertEqual(self._builder.count, 2 * len(boards)) + self.assertEqual(self._builder.count, 2 * len(BOARDS)) self.assertEqual(self._builder.fail, 0) # Each board has a config, and then one make per commit - self.assertEqual(self._make_calls, len(boards) * (1 + 2)) + self.assertEqual(self._make_calls, len(BOARDS) * (1 + 2)) def testIncremental(self): """Test building a branch twice - the second time should do nothing""" self._RunControl('-b', TEST_BRANCH, '-o', self._output_dir) # Each board has a mrproper, config, and then one make per commit - self.assertEqual(self._make_calls, len(boards) * (self._commits + 1)) + self.assertEqual(self._make_calls, len(BOARDS) * (self._commits + 1)) self._make_calls = 0 self._RunControl('-b', TEST_BRANCH, '-o', self._output_dir, clean_dir=False) self.assertEqual(self._make_calls, 0) @@ -516,19 +516,19 @@ class TestFunctional(unittest.TestCase): self._make_calls = 0 self._RunControl('-b', TEST_BRANCH, '-f', '-o', self._output_dir, clean_dir=False) # Each board has a config and one make per commit - self.assertEqual(self._make_calls, len(boards) * (self._commits + 1)) + self.assertEqual(self._make_calls, len(BOARDS) * (self._commits + 1)) def testForceReconfigure(self): """The -f flag should force a rebuild""" self._RunControl('-b', TEST_BRANCH, '-C', '-o', self._output_dir) # Each commit has a config and make - self.assertEqual(self._make_calls, len(boards) * self._commits * 2) + self.assertEqual(self._make_calls, len(BOARDS) * self._commits * 2) def testMrproper(self): """The -f flag should force a rebuild""" self._RunControl('-b', TEST_BRANCH, '-m', '-o', self._output_dir) # Each board has a mkproper, config and then one make per commit - self.assertEqual(self._make_calls, len(boards) * (self._commits + 2)) + self.assertEqual(self._make_calls, len(BOARDS) * (self._commits + 2)) def testErrors(self): """Test handling of build errors""" @@ -581,9 +581,9 @@ class TestFunctional(unittest.TestCase): def testWorkInOutput(self): """Test the -w option which should write directly to the output dir""" board_list = board.Boards() - board_list.AddBoard(board.Board(*boards[0])) + board_list.AddBoard(board.Board(*BOARDS[0])) self._RunControl('-o', self._output_dir, '-w', clean_dir=False, - boards=board_list) + brds=board_list) self.assertTrue( os.path.exists(os.path.join(self._output_dir, 'u-boot'))) self.assertTrue( @@ -600,14 +600,14 @@ class TestFunctional(unittest.TestCase): os.path.exists(os.path.join(self._output_dir, 'u-boot'))) board_list = board.Boards() - board_list.AddBoard(board.Board(*boards[0])) + board_list.AddBoard(board.Board(*BOARDS[0])) with self.assertRaises(SystemExit) as e: self._RunControl('-b', self._test_branch, '-o', self._output_dir, - '-w', clean_dir=False, boards=board_list) + '-w', clean_dir=False, brds=board_list) self.assertIn("single commit", str(e.exception)) board_list = board.Boards() - board_list.AddBoard(board.Board(*boards[0])) + board_list.AddBoard(board.Board(*BOARDS[0])) with self.assertRaises(SystemExit) as e: self._RunControl('-w', clean_dir=False) self.assertIn("specify -o", str(e.exception)) -- 2.37.0.144.g8ac04bfd2-goog