]> git.sur5r.net Git - u-boot/blobdiff - tools/buildman/buildman.py
dtoc: Add functions to add integer properties
[u-boot] / tools / buildman / buildman.py
index 70c2142901737e5fb2b97def38a2e1700371920a..f17aa15e7c548bbe9bb34402f072867c76c768fc 100755 (executable)
@@ -1,9 +1,8 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2
+# SPDX-License-Identifier: GPL-2.0+
 #
 # Copyright (c) 2012 The Chromium OS Authors.
 #
-# SPDX-License-Identifier:     GPL-2.0+
-#
 
 """See README for more information"""
 
@@ -15,10 +14,11 @@ 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'))
+sys.path.insert(1, os.path.join(our_path, '../patman'))
 
 # Our modules
 import board
+import bsettings
 import builder
 import checkpatch
 import cmdline
@@ -29,28 +29,23 @@ import patchstream
 import terminal
 import toolchain
 
-def RunTests():
+def RunTests(skip_net_tests):
+    import func_test
     import test
     import doctest
 
     result = unittest.TestResult()
-    for module in ['toolchain']:
+    for module in ['toolchain', 'gitutil']:
         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
-
     sys.argv = [sys.argv[0]]
-    suite = unittest.TestLoader().loadTestsFromTestCase(test.TestBuild)
-    result = unittest.TestResult()
-    suite.run(result)
+    if skip_net_tests:
+        test.use_network = False
+    for module in (test.TestBuild, func_test.TestFunctional):
+        suite = unittest.TestLoader().loadTestsFromTestCase(module)
+        suite.run(result)
 
-    # TODO: Surely we can just 'print' result?
     print result
     for test, err in result.errors:
         print err
@@ -62,9 +57,10 @@ options, args = cmdline.ParseArgs()
 
 # Run our meagre tests
 if options.test:
-    RunTests()
+    RunTests(options.skip_net_tests)
 
 # Build selected commits for selected boards
 else:
+    bsettings.Setup(options.config_file)
     ret_code = control.DoBuildman(options, args)
     sys.exit(ret_code)