summaryrefslogtreecommitdiffstats
path: root/tools/buildman/func_test.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-09-05 19:00:16 -0600
committerSimon Glass <sjg@chromium.org>2014-09-09 16:38:29 -0600
commit823e60b62a98061a662536093d46f8f26f6d318f (patch)
tree4fcdfcb64241665c7b713eadfe33fef83ef777fc /tools/buildman/func_test.py
parent8b985eebd0f7582614399fdf6c108a81ab446ae7 (diff)
downloadblackbird-obmc-uboot-823e60b62a98061a662536093d46f8f26f6d318f.tar.gz
blackbird-obmc-uboot-823e60b62a98061a662536093d46f8f26f6d318f.zip
buildman: Allow tests to have their own boards
Rather than reading boards.cfg, which may take time to generate and is not necessarily suitable for running tests, create our own list of boards. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/buildman/func_test.py')
-rw-r--r--tools/buildman/func_test.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py
index b92cde3607..237a80b430 100644
--- a/tools/buildman/func_test.py
+++ b/tools/buildman/func_test.py
@@ -10,6 +10,7 @@ import sys
import tempfile
import unittest
+import board
import bsettings
import cmdline
import command
@@ -34,6 +35,14 @@ chromeos_daisy=VBOOT=${chroot}/build/daisy/usr ${vboot}
chromeos_peach=VBOOT=${chroot}/build/peach_pit/usr ${vboot}
'''
+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', 'mpc5xx', '', 'Tester', 'PowerPC board 2', 'board3', ''],
+ ['Active', 'sandbox', 'sandbox', '', 'Tester', 'Sandbox board', 'board4', ''],
+]
+
class TestFunctional(unittest.TestCase):
"""Functional test for buildman.
@@ -55,6 +64,9 @@ class TestFunctional(unittest.TestCase):
self._toolchains.Add('gcc', test=False)
bsettings.Setup(None)
bsettings.AddFile(settings_data)
+ self._boards = board.Boards()
+ for brd in boards:
+ self._boards.AddBoard(board.Board(*brd))
def tearDown(self):
shutil.rmtree(self._base_dir)
@@ -67,7 +79,7 @@ class TestFunctional(unittest.TestCase):
sys.argv = [sys.argv[0]] + list(args)
options, args = cmdline.ParseArgs()
return control.DoBuildman(options, args, toolchains=self._toolchains,
- make_func=self._HandleMake)
+ make_func=self._HandleMake, boards=self._boards)
def testFullHelp(self):
command.test_result = None
@@ -194,6 +206,12 @@ class TestFunctional(unittest.TestCase):
print 'make', stage
sys.exit(1)
+ def testNoBoards(self):
+ """Test that buildman aborts when there are no boards"""
+ self._boards = board.Boards()
+ with self.assertRaises(SystemExit):
+ self._RunControl()
+
def testCurrentSource(self):
"""Very simple test to invoke buildman on the current source"""
self._RunControl()
OpenPOWER on IntegriCloud