]> Git Repo - J-u-boot.git/blame - tools/buildman/main.py
patman: Sort the command line options
[J-u-boot.git] / tools / buildman / main.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
0ede00fd 9import doctest
fc3fe1c2 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__))
0ede00fd 18sys.path.insert(1, os.path.join(our_path, '..'))
fc3fe1c2
SG
19
20# Our modules
0ede00fd
SG
21from buildman import board
22from buildman import bsettings
23from buildman import builder
24from buildman import cmdline
25from buildman import control
26from buildman import toolchain
bf776679
SG
27from patman import patchstream
28from patman import gitutil
29from patman import terminal
fc3fe1c2 30
cb39a109 31def RunTests(skip_net_tests):
d4144e45 32 import func_test
fc3fe1c2 33 import test
4281ad8e
SG
34 import doctest
35
36 result = unittest.TestResult()
b4fa9495 37 for module in ['buildman.toolchain', 'patman.gitutil']:
4281ad8e
SG
38 suite = doctest.DocTestSuite(module)
39 suite.run(result)
40
fc3fe1c2 41 sys.argv = [sys.argv[0]]
cb39a109
SG
42 if skip_net_tests:
43 test.use_network = False
d4144e45
SG
44 for module in (test.TestBuild, func_test.TestFunctional):
45 suite = unittest.TestLoader().loadTestsFromTestCase(module)
46 suite.run(result)
fc3fe1c2 47
c05aa036 48 print(result)
fc3fe1c2 49 for test, err in result.errors:
c05aa036 50 print(err)
fc3fe1c2 51 for test, err in result.failures:
c05aa036 52 print(err)
fc3fe1c2
SG
53
54
d3d5c123 55options, args = cmdline.ParseArgs()
fc3fe1c2
SG
56
57# Run our meagre tests
58if options.test:
cb39a109 59 RunTests(options.skip_net_tests)
fc3fe1c2
SG
60
61# Build selected commits for selected boards
62else:
fd03d63f 63 bsettings.Setup(options.config_file)
2c3deb97
SG
64 ret_code = control.DoBuildman(options, args)
65 sys.exit(ret_code)
This page took 0.303023 seconds and 4 git commands to generate.