| OLD | NEW |
| 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 |
| 11 import sys | 11 import sys |
| 12 import unittest | 12 import unittest |
| 13 | 13 |
| 14 import mb | 14 import mb |
| 15 | 15 |
| 16 | 16 |
| 17 class FakeMBW(mb.MetaBuildWrapper): | 17 class FakeMBW(mb.MetaBuildWrapper): |
| 18 def __init__(self, win32=False): | 18 def __init__(self, win32=False): |
| 19 super(FakeMBW, self).__init__() | 19 super(FakeMBW, self).__init__() |
| 20 | 20 |
| 21 # Override vars for test portability. | 21 # Override vars for test portability. |
| 22 if win32: | 22 if win32: |
| 23 self.chromium_src_dir = 'c:\\fake_src' | 23 self.chromium_src_dir = 'c:\\fake_src' |
| 24 self.default_config = 'c:\\fake_src\\tools\\mb\\mb_config.pyl' | 24 self.default_config = 'c:\\fake_src\\tools\\mb\\mb_config.pyl' |
| 25 self.default_isolate_map = ('c:\\fake_src\\testing\\buildbot\\' |
| 26 'gn_isolate_map.pyl') |
| 25 self.platform = 'win32' | 27 self.platform = 'win32' |
| 26 self.executable = 'c:\\python\\python.exe' | 28 self.executable = 'c:\\python\\python.exe' |
| 27 self.sep = '\\' | 29 self.sep = '\\' |
| 28 else: | 30 else: |
| 29 self.chromium_src_dir = '/fake_src' | 31 self.chromium_src_dir = '/fake_src' |
| 30 self.default_config = '/fake_src/tools/mb/mb_config.pyl' | 32 self.default_config = '/fake_src/tools/mb/mb_config.pyl' |
| 33 self.default_isolate_map = '/fake_src/testing/buildbot/gn_isolate_map.pyl' |
| 31 self.executable = '/usr/bin/python' | 34 self.executable = '/usr/bin/python' |
| 32 self.platform = 'linux2' | 35 self.platform = 'linux2' |
| 33 self.sep = '/' | 36 self.sep = '/' |
| 34 | 37 |
| 35 self.files = {} | 38 self.files = {} |
| 36 self.calls = [] | 39 self.calls = [] |
| 37 self.cmds = [] | 40 self.cmds = [] |
| 38 self.cross_compile = None | 41 self.cross_compile = None |
| 39 self.out = '' | 42 self.out = '' |
| 40 self.err = '' | 43 self.err = '' |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 self.check(['lookup', '-c', 'fake_config'], mbw=mbw, | 526 self.check(['lookup', '-c', 'fake_config'], mbw=mbw, |
| 524 ret=0, | 527 ret=0, |
| 525 out=("GYP_DEFINES='foo=bar baz=1'\n" | 528 out=("GYP_DEFINES='foo=bar baz=1'\n" |
| 526 "GYP_LINK_CONCURRENCY=1\n" | 529 "GYP_LINK_CONCURRENCY=1\n" |
| 527 "LLVM_FORCE_HEAD_REVISION=1\n" | 530 "LLVM_FORCE_HEAD_REVISION=1\n" |
| 528 "python build/gyp_chromium -G output_dir=_path_\n")) | 531 "python build/gyp_chromium -G output_dir=_path_\n")) |
| 529 | 532 |
| 530 | 533 |
| 531 if __name__ == '__main__': | 534 if __name__ == '__main__': |
| 532 unittest.main() | 535 unittest.main() |
| OLD | NEW |