OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import itertools | 5 import itertools |
6 import sys | 6 import sys |
7 import unittest | 7 import unittest |
8 | 8 |
9 import mopy.gn as gn | 9 import mopy.gn as gn |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 "target_os": [None, "android"], | 47 "target_os": [None, "android"], |
48 "target_cpu": ["x86", "x64", "arm", "arm64"], | 48 "target_cpu": ["x86", "x64", "arm", "arm64"], |
49 "is_debug": [False, True], | 49 "is_debug": [False, True], |
50 "is_official_build": [False, True], | 50 "is_official_build": [False, True], |
51 "is_clang": [False, True], | 51 "is_clang": [False, True], |
52 "is_asan": [False, True], | 52 "is_asan": [False, True], |
53 "use_goma": [False], | 53 "use_goma": [False], |
54 "mojo_use_nacl": [False, True], | 54 "mojo_use_nacl": [False, True], |
55 "mojo_use_go": [False], | 55 "mojo_use_go": [False], |
56 "dcheck_always_on": [False, True], | 56 "dcheck_always_on": [False, True], |
57 "ffmpeg_branding": ["ChromeOS"], | |
58 } | 57 } |
59 | 58 |
60 for args in _iterate_over_config(configs_to_test): | 59 for args in _iterate_over_config(configs_to_test): |
61 if args.get("target_os") == "android" and args["ffmpeg_branding"]: | |
62 continue | |
63 config = gn.ConfigForGNArgs(args) | 60 config = gn.ConfigForGNArgs(args) |
64 new_args = gn.GNArgsForConfig(config) | 61 new_args = gn.GNArgsForConfig(config) |
65 self.assertDictEqual(args, new_args) | 62 self.assertDictEqual(args, new_args) |
66 | 63 |
67 | 64 |
68 def _iterate_over_config(config): | 65 def _iterate_over_config(config): |
69 def product_to_dict(p): | 66 def product_to_dict(p): |
70 return dict(filter(lambda x: x[1] is not None, zip(config.keys(), p))) | 67 return dict(filter(lambda x: x[1] is not None, zip(config.keys(), p))) |
71 return itertools.imap(product_to_dict, itertools.product(*config.values())) | 68 return itertools.imap(product_to_dict, itertools.product(*config.values())) |
72 | 69 |
73 | 70 |
74 if __name__ == "__main__": | 71 if __name__ == "__main__": |
75 unittest.main() | 72 unittest.main() |
OLD | NEW |