]> git.ipfire.org Git - thirdparty/u-boot.git/blame - tools/buildman/buildman.py
patman: Drop references to __future__
[thirdparty/u-boot.git] / tools / buildman / buildman.py
CommitLineData
c05aa036 1#!/usr/bin/env python3
83d290c5 2# SPDX-License-Identifier: GPL-2.0+
fc3fe1c2
SG
3#
4# Copyright (c) 2012 The Chromium OS Authors.
5#
fc3fe1c2
SG
6
7"""See README for more information"""
8
9import multiprocessing
fc3fe1c2
SG
10import os
11import re
12import sys
13import unittest
14
15# Bring in the patman libraries
16our_path = os.path.dirname(os.path.realpath(__file__))
a556eeeb 17sys.path.insert(1, os.path.join(our_path, '../patman'))
fc3fe1c2
SG
18
19# Our modules
20import board
fd03d63f 21import bsettings
fc3fe1c2
SG
22import builder
23import checkpatch
d3d5c123 24import cmdline
fc3fe1c2
SG
25import control
26import doctest
27import gitutil
28import patchstream
29import terminal
30import toolchain
31
cb39a109 32def RunTests(skip_net_tests):
d4144e45 33 import func_test
fc3fe1c2 34 import test
4281ad8e
SG
35 import doctest
36
37 result = unittest.TestResult()
d4144e45 38 for module in ['toolchain', 'gitutil']:
4281ad8e
SG
39 suite = doctest.DocTestSuite(module)
40 suite.run(result)
41
fc3fe1c2 42 sys.argv = [sys.argv[0]]
cb39a109
SG
43 if skip_net_tests:
44 test.use_network = False
d4144e45
SG
45 for module in (test.TestBuild, func_test.TestFunctional):
46 suite = unittest.TestLoader().loadTestsFromTestCase(module)
47 suite.run(result)
fc3fe1c2 48
c05aa036 49 print(result)
fc3fe1c2 50 for test, err in result.errors:
c05aa036 51 print(err)
fc3fe1c2 52 for test, err in result.failures:
c05aa036 53 print(err)
fc3fe1c2
SG
54
55
d3d5c123 56options, args = cmdline.ParseArgs()
fc3fe1c2
SG
57
58# Run our meagre tests
59if options.test:
cb39a109 60 RunTests(options.skip_net_tests)
fc3fe1c2
SG
61
62# Build selected commits for selected boards
63else:
fd03d63f 64 bsettings.Setup(options.config_file)
2c3deb97
SG
65 ret_code = control.DoBuildman(options, args)
66 sys.exit(ret_code)