Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Unified Diff: tools/mb/mb_unittest.py

Issue 1078913003: Fix error code propagation in 'mb gen'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean up test code Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/mb/mb.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/mb/mb_unittest.py
diff --git a/tools/mb/mb_unittest.py b/tools/mb/mb_unittest.py
index efb453c26845840c09989f5ce3153b0e223676be..ac822ab49746e9c3da6475ce1985cb7793f44502 100644
--- a/tools/mb/mb_unittest.py
+++ b/tools/mb/mb_unittest.py
@@ -100,12 +100,12 @@ TEST_CONFIG = """\
class UnitTest(unittest.TestCase):
- def fake_mbw(self, files):
+ def fake_mbw(self, files=None):
mbw = FakeMBW()
+ mbw.files.setdefault(mbw.default_config, TEST_CONFIG)
Dirk Pranke 2015/04/24 20:38:52 these diffs are unrelated to the fix, but clean up
if files:
for path, contents in files.items():
mbw.files[path] = contents
- mbw.files.setdefault(mbw.default_config, TEST_CONFIG)
return mbw
def check(self, args, mbw=None, files=None, out=None, err=None, ret=None):
@@ -180,6 +180,12 @@ class UnitTest(unittest.TestCase):
self.check(['gen', '-c', 'gn_debug', '//out/Default'], ret=0)
self.check(['gen', '-c', 'gyp_rel_bot', '//out/Release'], ret=0)
+ def test_gen_fails(self):
+ mbw = self.fake_mbw()
+ mbw.Call = lambda cmd: (1, '', '')
+ self.check(['gen', '-c', 'gn_debug', '//out/Default'], mbw=mbw, ret=1)
+ self.check(['gen', '-c', 'gyp_rel_bot', '//out/Release'], mbw=mbw, ret=1)
+
def test_goma_dir_expansion(self):
self.check(['lookup', '-c', 'gyp_rel_bot', '-g', '/foo'], ret=0,
out=("python build/gyp_chromium -G 'output_dir=<path>' "
« no previous file with comments | « tools/mb/mb.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698