2 # SPDX-License-Identifier: GPL-2.0+
4 # Copyright (c) 2012 The Chromium OS Authors.
7 """See README for more information"""
10 import multiprocessing
16 # Bring in the patman libraries
17 our_path = os.path.dirname(os.path.realpath(__file__))
18 sys.path.insert(1, os.path.join(our_path, '..'))
21 from buildman import board
22 from buildman import bsettings
23 from buildman import builder
24 from buildman import cmdline
25 from buildman import control
26 from buildman import toolchain
27 from patman import patchstream
28 from patman import gitutil
29 from patman import terminal
30 from patman import test_util
32 def RunTests(skip_net_tests, verboose, args):
37 result = unittest.TestResult()
38 test_name = args and args[0] or None
40 test.use_network = False
42 # Run the entry tests first ,since these need to be the first to import the
44 test_util.run_test_suites(
45 result, False, verboose, False, None, test_name, [],
46 [test.TestBuild, func_test.TestFunctional,
47 'buildman.toolchain', 'patman.gitutil'])
49 return test_util.report_result('buildman', test_name, result)
51 options, args = cmdline.ParseArgs()
54 sys.tracebacklimit = 0
56 # Run our meagre tests
58 RunTests(options.skip_net_tests, options.verbose, args)
60 # Build selected commits for selected boards
62 bsettings.Setup(options.config_file)
63 ret_code = control.DoBuildman(options, args)