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():
|
2014-09-06 01:00:13 +00:00
|
|
|
import func_test
|
2013-04-03 11:07:16 +00:00
|
|
|
import test
|
2013-09-23 23:35:17 +00:00
|
|
|
import doctest
|
|
|
|
|
|
|
|
result = unittest.TestResult()
|
2014-09-06 01:00:13 +00:00
|
|
|
for module in ['toolchain', 'gitutil']:
|
2013-09-23 23:35:17 +00:00
|
|
|
suite = doctest.DocTestSuite(module)
|
|
|
|
suite.run(result)
|
|
|
|
|
2013-04-03 11:07:16 +00:00
|
|
|
sys.argv = [sys.argv[0]]
|
2014-09-06 01:00:13 +00:00
|
|
|
for module in (test.TestBuild, func_test.TestFunctional):
|
|
|
|
suite = unittest.TestLoader().loadTestsFromTestCase(module)
|
|
|
|
suite.run(result)
|
2013-04-03 11:07:16 +00:00
|
|
|
|
|
|
|
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)
|