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

Unified Diff: tools/mb/mb_unittest.py

Issue 1131623006: Use a response file for gn refs when running 'analyze' on gn bots. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix formatting nits Created 5 years, 7 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 ac822ab49746e9c3da6475ce1985cb7793f44502..4eb79b45acb954b1193821b46f95ec3aba1a0f75 100644
--- a/tools/mb/mb_unittest.py
+++ b/tools/mb/mb_unittest.py
@@ -47,6 +47,26 @@ class FakeMBW(mb.MetaBuildWrapper):
else:
self.out += sep.join(args) + end
+ def TempFile(self):
+ return FakeFile(self.files)
+
+ def RemoveFile(self, path):
+ del self.files[path]
+
+
+class FakeFile(object):
+ def __init__(self, files):
+ self.name = '/tmp/file'
+ self.buf = ''
+ self.files = files
+
+ def write(self, contents):
+ self.buf += contents
+
+ def close(self):
+ self.files[self.name] = self.buf
+
+
class IntegrationTest(unittest.TestCase):
def test_validate(self):
# Note that this validates that the actual mb_config.pyl is valid.
@@ -126,6 +146,7 @@ class UnitTest(unittest.TestCase):
"files": ["foo/foo_unittest.cc"],
"targets": ["foo_unittests", "bar_unittests"]
}"""}
+
mbw = self.fake_mbw(files)
mbw.Call = lambda cmd: (0, 'out/Default/foo_unittests\n', '')
« 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