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

Side by Side Diff: tools/mb/mb_unittest.py

Issue 1342563002: Clean up logging in MB. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: catch gn gen failure Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « tools/mb/mb.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Tests for mb.py.""" 6 """Tests for mb.py."""
7 7
8 import json 8 import json
9 import StringIO 9 import StringIO
10 import sys 10 import sys
(...skipping 20 matching lines...) Expand all
31 31
32 def Exists(self, path): 32 def Exists(self, path):
33 return self.files.get(path) is not None 33 return self.files.get(path) is not None
34 34
35 def MaybeMakeDirectory(self, path): 35 def MaybeMakeDirectory(self, path):
36 pass 36 pass
37 37
38 def ReadFile(self, path): 38 def ReadFile(self, path):
39 return self.files[path] 39 return self.files[path]
40 40
41 def WriteFile(self, path, contents): 41 def WriteFile(self, path, contents, force_verbose=False):
42 self.files[path] = contents 42 self.files[path] = contents
43 43
44 def Call(self, cmd, env=None): 44 def Call(self, cmd, env=None):
45 if env: 45 if env:
46 self.cross_compile = env.get('GYP_CROSSCOMPILE') 46 self.cross_compile = env.get('GYP_CROSSCOMPILE')
47 self.calls.append(cmd) 47 self.calls.append(cmd)
48 if self.cmds: 48 if self.cmds:
49 return self.cmds.pop(0) 49 return self.cmds.pop(0)
50 return 0, '', '' 50 return 0, '', ''
51 51
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 finally: 275 finally:
276 sys.stdout = orig_stdout 276 sys.stdout = orig_stdout
277 277
278 278
279 def test_validate(self): 279 def test_validate(self):
280 self.check(['validate'], ret=0) 280 self.check(['validate'], ret=0)
281 281
282 282
283 if __name__ == '__main__': 283 if __name__ == '__main__':
284 unittest.main() 284 unittest.main()
OLDNEW
« 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