OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 # | 3 # |
4 # Use of this source code is governed by a BSD-style license | 4 # Use of this source code is governed by a BSD-style license |
5 # that can be found in the LICENSE file in the root of the source | 5 # that can be found in the LICENSE file in the root of the source |
6 # tree. An additional intellectual property rights grant can be found | 6 # tree. An additional intellectual property rights grant can be found |
7 # in the file PATENTS. All contributing project authors may | 7 # in the file PATENTS. All contributing project authors may |
8 # be found in the AUTHORS file in the root of the source tree. | 8 # be found in the AUTHORS file in the root of the source tree. |
9 | 9 |
10 """Tests for mb.py.""" | 10 """Tests for mb.py.""" |
11 | 11 |
12 import ast | 12 import ast |
13 import json | 13 import json |
14 import StringIO | 14 import StringIO |
15 import os | 15 import os |
16 import sys | 16 import sys |
17 import unittest | 17 import unittest |
18 | 18 |
19 import mb | 19 import mb |
20 | 20 |
21 | 21 |
22 class FakeMBW(mb.MetaBuildWrapper): | 22 class FakeMBW(mb.MetaBuildWrapper): |
23 def __init__(self, win32=False): | 23 def __init__(self, win32=False): |
24 super(FakeMBW, self).__init__() | 24 super(FakeMBW, self).__init__() |
25 | 25 |
26 # Override vars for test portability. | 26 # Override vars for test portability. |
27 if win32: | 27 if win32: |
28 self.src_dir = 'c:\\fake_src' | 28 self.chromium_src_dir = 'c:\\fake_src' |
29 self.default_config = 'c:\\fake_src\\tools-webrtc\\mb\\mb_config.pyl' | 29 self.default_config = 'c:\\fake_src\\tools-webrtc\\mb\\mb_config.pyl' |
30 self.default_isolate_map = ('c:\\fake_src\\testing\\buildbot\\' | 30 self.default_isolate_map = ('c:\\fake_src\\testing\\buildbot\\' |
31 'gn_isolate_map.pyl') | 31 'gn_isolate_map.pyl') |
32 self.platform = 'win32' | 32 self.platform = 'win32' |
33 self.executable = 'c:\\python\\python.exe' | 33 self.executable = 'c:\\python\\python.exe' |
34 self.sep = '\\' | 34 self.sep = '\\' |
35 else: | 35 else: |
36 self.src_dir = '/fake_src' | 36 self.chromium_src_dir = '/fake_src' |
37 self.default_config = '/fake_src/tools-webrtc/mb/mb_config.pyl' | 37 self.default_config = '/fake_src/tools-webrtc/mb/mb_config.pyl' |
38 self.default_isolate_map = '/fake_src/testing/buildbot/gn_isolate_map.pyl' | 38 self.default_isolate_map = '/fake_src/testing/buildbot/gn_isolate_map.pyl' |
39 self.executable = '/usr/bin/python' | 39 self.executable = '/usr/bin/python' |
40 self.platform = 'linux2' | 40 self.platform = 'linux2' |
41 self.sep = '/' | 41 self.sep = '/' |
42 | 42 |
43 self.files = {} | 43 self.files = {} |
44 self.calls = [] | 44 self.calls = [] |
45 self.cmds = [] | 45 self.cmds = [] |
46 self.cross_compile = None | 46 self.cross_compile = None |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 self.check(['lookup', '-c', 'fake_config'], mbw=mbw, | 775 self.check(['lookup', '-c', 'fake_config'], mbw=mbw, |
776 ret=0, | 776 ret=0, |
777 out=("GYP_DEFINES='foo=bar baz=1'\n" | 777 out=("GYP_DEFINES='foo=bar baz=1'\n" |
778 "GYP_LINK_CONCURRENCY=1\n" | 778 "GYP_LINK_CONCURRENCY=1\n" |
779 "LLVM_FORCE_HEAD_REVISION=1\n" | 779 "LLVM_FORCE_HEAD_REVISION=1\n" |
780 "python build/gyp_chromium -G output_dir=_path_\n")) | 780 "python build/gyp_chromium -G output_dir=_path_\n")) |
781 | 781 |
782 | 782 |
783 if __name__ == '__main__': | 783 if __name__ == '__main__': |
784 unittest.main() | 784 unittest.main() |
OLD | NEW |