Merge branch 'master' of http://git.denx.de/u-boot-mmc
[platform/kernel/u-boot.git] / tools / buildman / buildman.py
index c4de857..607429d 100755 (executable)
@@ -15,10 +15,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
@@ -30,27 +31,20 @@ import terminal
 import toolchain
 
 def RunTests():
+    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)
+    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
@@ -63,14 +57,9 @@ options, args = cmdline.ParseArgs()
 # Run our meagre tests
 if options.test:
     RunTests()
-elif options.full_help:
-    pager = os.getenv('PAGER')
-    if not pager:
-        pager = 'more'
-    fname = os.path.join(os.path.dirname(sys.argv[0]), 'README')
-    command.Run(pager, fname)
 
 # Build selected commits for selected boards
 else:
+    bsettings.Setup(options.config_file)
     ret_code = control.DoBuildman(options, args)
     sys.exit(ret_code)