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

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

Issue 2027823002: Update mb.py to support gn directories with no args.gn (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Proper detection of gn directories Created 4 years, 6 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 os 10 import os
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 '-c', 'gn_debug_goma', 361 '-c', 'gn_debug_goma',
362 '--swarming-targets-file', '/tmp/swarming_targets', 362 '--swarming-targets-file', '/tmp/swarming_targets',
363 '//out/Default'], mbw=mbw, ret=0) 363 '//out/Default'], mbw=mbw, ret=0)
364 self.assertIn('/fake_src/out/Default/base_unittests.isolate', 364 self.assertIn('/fake_src/out/Default/base_unittests.isolate',
365 mbw.files) 365 mbw.files)
366 self.assertIn('/fake_src/out/Default/base_unittests.isolated.gen.json', 366 self.assertIn('/fake_src/out/Default/base_unittests.isolated.gen.json',
367 mbw.files) 367 mbw.files)
368 368
369 def test_gn_isolate(self): 369 def test_gn_isolate(self):
370 files = { 370 files = {
371 '/fake_src/out/Default/toolchain.ninja': "",
371 '/fake_src/testing/buildbot/gn_isolate_map.pyl': ( 372 '/fake_src/testing/buildbot/gn_isolate_map.pyl': (
372 "{'base_unittests': {" 373 "{'base_unittests': {"
373 " 'label': '//base:base_unittests'," 374 " 'label': '//base:base_unittests',"
374 " 'type': 'raw'," 375 " 'type': 'raw',"
375 " 'args': []," 376 " 'args': [],"
376 "}}\n" 377 "}}\n"
377 ), 378 ),
378 '/fake_src/out/Default/base_unittests.runtime_deps': ( 379 '/fake_src/out/Default/base_unittests.runtime_deps': (
379 "base_unittests\n" 380 "base_unittests\n"
380 ), 381 ),
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 self.check(['validate'], mbw=mbw, ret=0) 469 self.check(['validate'], mbw=mbw, ret=0)
469 470
470 def test_bad_validate(self): 471 def test_bad_validate(self):
471 mbw = self.fake_mbw() 472 mbw = self.fake_mbw()
472 mbw.files[mbw.default_config] = TEST_BAD_CONFIG 473 mbw.files[mbw.default_config] = TEST_BAD_CONFIG
473 self.check(['validate'], mbw=mbw, ret=1) 474 self.check(['validate'], mbw=mbw, ret=1)
474 475
475 476
476 if __name__ == '__main__': 477 if __name__ == '__main__':
477 unittest.main() 478 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