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