[PATCH v4 30/83] buildman: Add tests for excluding things

Simon Glass sjg at chromium.org
Thu Jul 20 01:48:38 CEST 2023


Add some tests for the -x flag.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

(no changes since v3)

Changes in v3:
- Add new patch to test for excluding things

 tools/buildman/func_test.py | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py
index ca579a27c61f..bd7db1e9c1fb 100644
--- a/tools/buildman/func_test.py
+++ b/tools/buildman/func_test.py
@@ -1023,3 +1023,27 @@ endif
             result = self._RunControl('-A', 'board0')
         self.assertEqual('arm-\n', stdout.getvalue())
         self.assertEqual('', stderr.getvalue())
+
+    def test_exclude_one(self):
+        """Test excluding a single board from an arch"""
+        self._RunControl('arm', '-x', 'board1')
+        self.assertEqual(['board0'],
+                         [b.target for b in self._boards.get_selected()])
+
+    def test_exclude_arch(self):
+        """Test excluding an arch"""
+        self._RunControl('-x', 'arm')
+        self.assertEqual(['board2', 'board4'],
+                         [b.target for b in self._boards.get_selected()])
+
+    def test_exclude_comma(self):
+        """Test excluding a comma-separated list of things"""
+        self._RunControl('-x', 'arm,powerpc')
+        self.assertEqual(['board4'],
+                         [b.target for b in self._boards.get_selected()])
+
+    def test_exclude_list(self):
+        """Test excluding a list of things"""
+        self._RunControl('-x', 'board2', '-x' 'board4')
+        self.assertEqual(['board0', 'board1'],
+                         [b.target for b in self._boards.get_selected()])
-- 
2.41.0.487.g6d72f3e995-goog



More information about the U-Boot mailing list