2013-09-28 17:38:14 +00:00
|
|
|
#!/usr/bin/env python
|
2013-04-03 11:07:16 +00:00
|
|
|
#
|
|
|
|
# Copyright (c) 2012 The Chromium OS Authors.
|
|
|
|
#
|
2013-07-08 07:37:19 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
2013-04-03 11:07:16 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
"""See README for more information"""
|
|
|
|
|
|
|
|
import multiprocessing
|
|
|
|
import os
|
|
|
|
import re
|
|
|
|
import sys
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
# Bring in the patman libraries
|
|
|
|
our_path = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
sys.path.append(os.path.join(our_path, '../patman'))
|
|
|
|
|
|
|
|
# Our modules
|
|
|
|
import board
|
|
|
|
import builder
|
|
|
|
import checkpatch
|
2014-09-06 01:00:10 +00:00
|
|
|
import cmdline
|
2013-04-03 11:07:16 +00:00
|
|
|
import control
|
|
|
|
import doctest
|
|
|
|
import gitutil
|
|
|
|
import patchstream
|
|
|
|
import terminal
|
|
|
|
import toolchain
|
|
|
|
|
|
|
|
def RunTests():
|
|
|
|
import test
|
2013-09-23 23:35:17 +00:00
|
|
|
import doctest
|
|
|
|
|
|
|
|
result = unittest.TestResult()
|
|
|
|
for module in ['toolchain']:
|
|
|
|
suite = doctest.DocTestSuite(module)
|
|
|
|
suite.run(result)
|
|
|
|
|
|
|
|
# TODO: Surely we can just 'print' result?
|
|
|
|
print result
|
|
|
|
for test, err in result.errors:
|
|
|
|
print err
|
|
|
|
for test, err in result.failures:
|
|
|
|
print err
|
2013-04-03 11:07:16 +00:00
|
|
|
|
|
|
|
sys.argv = [sys.argv[0]]
|
|
|
|
suite = unittest.TestLoader().loadTestsFromTestCase(test.TestBuild)
|
|
|
|
result = unittest.TestResult()
|
|
|
|
suite.run(result)
|
|
|
|
|
|
|
|
# TODO: Surely we can just 'print' result?
|
|
|
|
print result
|
|
|
|
for test, err in result.errors:
|
|
|
|
print err
|
|
|
|
for test, err in result.failures:
|
|
|
|
print err
|
|
|
|
|
|
|
|
|
2014-09-06 01:00:10 +00:00
|
|
|
options, args = cmdline.ParseArgs()
|
2013-04-03 11:07:16 +00:00
|
|
|
|
|
|
|
# Run our meagre tests
|
|
|
|
if options.test:
|
|
|
|
RunTests()
|
|
|
|
|
|
|
|
# Build selected commits for selected boards
|
|
|
|
else:
|
2014-08-28 15:43:39 +00:00
|
|
|
ret_code = control.DoBuildman(options, args)
|
|
|
|
sys.exit(ret_code)
|