summaryrefslogtreecommitdiff
path: root/tools/buildman
diff options
context:
space:
mode:
Diffstat (limited to 'tools/buildman')
-rwxr-xr-xtools/buildman/buildman.py6
-rw-r--r--tools/buildman/cmdline.py2
-rw-r--r--tools/buildman/test.py38
3 files changed, 32 insertions, 14 deletions
diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py
index 607429df7bc..11a4f162c5f 100755
--- a/tools/buildman/buildman.py
+++ b/tools/buildman/buildman.py
@@ -30,7 +30,7 @@ import patchstream
import terminal
import toolchain
-def RunTests():
+def RunTests(skip_net_tests):
import func_test
import test
import doctest
@@ -41,6 +41,8 @@ def RunTests():
suite.run(result)
sys.argv = [sys.argv[0]]
+ if skip_net_tests:
+ test.use_network = False
for module in (test.TestBuild, func_test.TestFunctional):
suite = unittest.TestLoader().loadTestsFromTestCase(module)
suite.run(result)
@@ -56,7 +58,7 @@ options, args = cmdline.ParseArgs()
# Run our meagre tests
if options.test:
- RunTests()
+ RunTests(options.skip_net_tests)
# Build selected commits for selected boards
else:
diff --git a/tools/buildman/cmdline.py b/tools/buildman/cmdline.py
index 0060e0317c7..74247f0aff1 100644
--- a/tools/buildman/cmdline.py
+++ b/tools/buildman/cmdline.py
@@ -82,6 +82,8 @@ def ParseArgs():
default=False, help='Show a build summary')
parser.add_option('-S', '--show-sizes', action='store_true',
default=False, help='Show image size variation in summary')
+ parser.add_option('--skip-net-tests', action='store_true', default=False,
+ help='Skip tests which need the network')
parser.add_option('--step', type='int',
default=1, help='Only build every n commits (0=just first and last)')
parser.add_option('-t', '--test', action='store_true', dest='test',
diff --git a/tools/buildman/test.py b/tools/buildman/test.py
index 53ebc3756c9..e564a8a142f 100644
--- a/tools/buildman/test.py
+++ b/tools/buildman/test.py
@@ -24,6 +24,8 @@ import commit
import terminal
import toolchain
+use_network = True
+
settings_data = '''
# Buildman settings file
@@ -89,6 +91,7 @@ boards = [
['Active', 'arm', 'armv7', '', 'Tester', 'ARM Board 1', 'board0', ''],
['Active', 'arm', 'armv7', '', 'Tester', 'ARM Board 2', 'board1', ''],
['Active', 'powerpc', 'powerpc', '', 'Tester', 'PowerPC board 1', 'board2', ''],
+ ['Active', 'powerpc', 'mpc83xx', '', 'Tester', 'PowerPC board 2', 'board3', ''],
['Active', 'sandbox', 'sandbox', '', 'Tester', 'Sandbox board', 'board4', ''],
]
@@ -311,50 +314,60 @@ class TestBuild(unittest.TestCase):
def testBoardSingle(self):
"""Test single board selection"""
self.assertEqual(self.boards.SelectBoards(['sandbox']),
- {'all': 1, 'sandbox': 1})
+ {'all': ['board4'], 'sandbox': ['board4']})
def testBoardArch(self):
"""Test single board selection"""
self.assertEqual(self.boards.SelectBoards(['arm']),
- {'all': 2, 'arm': 2})
+ {'all': ['board0', 'board1'],
+ 'arm': ['board0', 'board1']})
def testBoardArchSingle(self):
"""Test single board selection"""
self.assertEqual(self.boards.SelectBoards(['arm sandbox']),
- {'all': 3, 'arm': 2, 'sandbox' : 1})
+ {'sandbox': ['board4'],
+ 'all': ['board0', 'board1', 'board4'],
+ 'arm': ['board0', 'board1']})
+
def testBoardArchSingleMultiWord(self):
"""Test single board selection"""
self.assertEqual(self.boards.SelectBoards(['arm', 'sandbox']),
- {'all': 3, 'arm': 2, 'sandbox' : 1})
+ {'sandbox': ['board4'], 'all': ['board0', 'board1', 'board4'], 'arm': ['board0', 'board1']})
def testBoardSingleAnd(self):
"""Test single board selection"""
self.assertEqual(self.boards.SelectBoards(['Tester & arm']),
- {'all': 2, 'Tester&arm': 2})
+ {'Tester&arm': ['board0', 'board1'], 'all': ['board0', 'board1']})
def testBoardTwoAnd(self):
"""Test single board selection"""
self.assertEqual(self.boards.SelectBoards(['Tester', '&', 'arm',
'Tester' '&', 'powerpc',
'sandbox']),
- {'all': 5, 'Tester&powerpc': 2, 'Tester&arm': 2,
- 'sandbox' : 1})
+ {'sandbox': ['board4'],
+ 'all': ['board0', 'board1', 'board2', 'board3',
+ 'board4'],
+ 'Tester&powerpc': ['board2', 'board3'],
+ 'Tester&arm': ['board0', 'board1']})
def testBoardAll(self):
"""Test single board selection"""
- self.assertEqual(self.boards.SelectBoards([]), {'all': 5})
+ self.assertEqual(self.boards.SelectBoards([]),
+ {'all': ['board0', 'board1', 'board2', 'board3',
+ 'board4']})
def testBoardRegularExpression(self):
"""Test single board selection"""
self.assertEqual(self.boards.SelectBoards(['T.*r&^Po']),
- {'T.*r&^Po': 2, 'all': 2})
+ {'all': ['board2', 'board3'],
+ 'T.*r&^Po': ['board2', 'board3']})
def testBoardDuplicate(self):
"""Test single board selection"""
self.assertEqual(self.boards.SelectBoards(['sandbox sandbox',
'sandbox']),
- {'all': 1, 'sandbox': 1})
+ {'all': ['board4'], 'sandbox': ['board4']})
def CheckDirs(self, build, dirname):
self.assertEqual('base%s' % dirname, build._GetOutputDir(1))
self.assertEqual('base%s/fred' % dirname,
@@ -410,8 +423,9 @@ class TestBuild(unittest.TestCase):
def testToolchainDownload(self):
"""Test that we can download toolchains"""
- self.assertEqual('https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/x86_64-gcc-4.9.0-nolibc_arm-unknown-linux-gnueabi.tar.xz',
- self.toolchains.LocateArchUrl('arm'))
+ if use_network:
+ self.assertEqual('https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/x86_64-gcc-4.9.0-nolibc_arm-unknown-linux-gnueabi.tar.xz',
+ self.toolchains.LocateArchUrl('arm'))
if __name__ == "__main__":