buildman: Support single-threaded operation

At present even if only a single thread is in use, buildman still uses
threading.

For some debugging it is helpful to do everything in the main process.
Allow -T0 to support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2021-01-30 22:17:46 -07:00
committed by Tom Rini
parent d6bf36c775
commit b82492bbcc
6 changed files with 68 additions and 30 deletions

View File

@@ -187,7 +187,7 @@ class TestBuild(unittest.TestCase):
expect += col.Color(expected_colour, ' %s' % board)
self.assertEqual(text, expect)
def _SetupTest(self, echo_lines=False, **kwdisplay_args):
def _SetupTest(self, echo_lines=False, threads=1, **kwdisplay_args):
"""Set up the test by running a build and summary
Args:
@@ -199,8 +199,8 @@ class TestBuild(unittest.TestCase):
Returns:
Iterator containing the output lines, each a PrintLine() object
"""
build = builder.Builder(self.toolchains, self.base_dir, None, 1, 2,
checkout=False, show_unknown=False)
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()
@@ -438,6 +438,12 @@ class TestBuild(unittest.TestCase):
filter_migration_warnings=True)
self._CheckOutput(lines, filter_migration_warnings=True)
def testSingleThread(self):
"""Test operation without threading"""
lines = self._SetupTest(show_errors=True, threads=0)
self._CheckOutput(lines, list_error_boards=False,
filter_dtb_warnings=False)
def _testGit(self):
"""Test basic builder operation by building a branch"""
options = Options()