summaryrefslogtreecommitdiff
path: root/tools/buildman/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/buildman/test.py')
-rw-r--r--tools/buildman/test.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/tools/buildman/test.py b/tools/buildman/test.py
index 502c9b4..a51c942 100644
--- a/tools/buildman/test.py
+++ b/tools/buildman/test.py
@@ -165,5 +165,53 @@ class TestBuild(unittest.TestCase):
args = ['tegra20']
control.DoBuildman(options, args)
+ def testBoardSingle(self):
+ """Test single board selection"""
+ self.assertEqual(self.boards.SelectBoards(['sandbox']),
+ {'all': 1, 'sandbox': 1})
+
+ def testBoardArch(self):
+ """Test single board selection"""
+ self.assertEqual(self.boards.SelectBoards(['arm']),
+ {'all': 2, 'arm': 2})
+
+ def testBoardArchSingle(self):
+ """Test single board selection"""
+ self.assertEqual(self.boards.SelectBoards(['arm sandbox']),
+ {'all': 3, 'arm': 2, 'sandbox' : 1})
+
+ def testBoardArchSingleMultiWord(self):
+ """Test single board selection"""
+ self.assertEqual(self.boards.SelectBoards(['arm', 'sandbox']),
+ {'all': 3, 'arm': 2, 'sandbox' : 1})
+
+ def testBoardSingleAnd(self):
+ """Test single board selection"""
+ self.assertEqual(self.boards.SelectBoards(['Tester & arm']),
+ {'all': 2, 'Tester&arm': 2})
+
+ 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})
+
+ def testBoardAll(self):
+ """Test single board selection"""
+ self.assertEqual(self.boards.SelectBoards([]), {'all': 5})
+
+ def testBoardRegularExpression(self):
+ """Test single board selection"""
+ self.assertEqual(self.boards.SelectBoards(['T.*r&^Po']),
+ {'T.*r&^Po': 2, 'all': 2})
+
+ def testBoardDuplicate(self):
+ """Test single board selection"""
+ self.assertEqual(self.boards.SelectBoards(['sandbox sandbox',
+ 'sandbox']),
+ {'all': 1, 'sandbox': 1})
+
if __name__ == "__main__":
unittest.main()