buildman: Print a message indicating the build is starting
[oweals/u-boot.git] / tools / buildman / test.py
index d19f6ea3d6c6ecab976bfad2d4cff510a097664e..ed2a3a8929bb4af9ca364f5971e8c97412980d2f 100644 (file)
@@ -169,7 +169,7 @@ class TestBuild(unittest.TestCase):
         expected_colour = col.GREEN if ok else col.RED
         expect = '%10s: ' % arch
         # TODO(sjg@chromium.org): If plus is '', we shouldn't need this
-        expect += col.Color(expected_colour, plus)
+        expect += ' ' + col.Color(expected_colour, plus)
         expect += '  '
         for board in boards:
             expect += col.Color(expected_colour, ' %s' % board)
@@ -198,9 +198,9 @@ class TestBuild(unittest.TestCase):
             if line.text.strip():
                 count += 1
 
-        # We should get one starting message, then an update for every commit
+        # We should get two starting messages, then an update for every commit
         # built.
-        self.assertEqual(count, len(commits) * len(boards) + 1)
+        self.assertEqual(count, len(commits) * len(boards) + 2)
         build.SetDisplayOptions(show_errors=True);
         build.ShowSummary(self.commits, board_selected)
         #terminal.EchoPrintTestLines()
@@ -394,5 +394,26 @@ class TestBuild(unittest.TestCase):
         build.commit_count = 0
         self.CheckDirs(build, '')
 
+    def testToolchainAliases(self):
+        self.assertTrue(self.toolchains.Select('arm') != None)
+        with self.assertRaises(ValueError):
+            self.toolchains.Select('no-arch')
+        with self.assertRaises(ValueError):
+            self.toolchains.Select('x86')
+
+        self.toolchains = toolchain.Toolchains()
+        self.toolchains.Add('x86_64-linux-gcc', test=False)
+        self.assertTrue(self.toolchains.Select('x86') != None)
+
+        self.toolchains = toolchain.Toolchains()
+        self.toolchains.Add('i386-linux-gcc', test=False)
+        self.assertTrue(self.toolchains.Select('x86') != None)
+
+    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 __name__ == "__main__":
     unittest.main()