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

Unified Diff: mojo/tools/mopy/gn_unittest.py

Issue 878933003: Move the apptest runner and parts of mopy to the public SDK. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/tools/mopy/gn.py ('k') | mojo/tools/mopy/gtest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/tools/mopy/gn_unittest.py
diff --git a/mojo/tools/mopy/gn_unittest.py b/mojo/tools/mopy/gn_unittest.py
deleted file mode 100644
index ca391f3d0f58d10c0ca5604f91373eda790a005c..0000000000000000000000000000000000000000
--- a/mojo/tools/mopy/gn_unittest.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import itertools
-import sys
-import unittest
-
-import mopy.gn as gn
-
-from mopy.config import Config
-
-
-class GTestListTestsTest(unittest.TestCase):
- """Tests mopy.gn."""
-
- def testConfigToGNToConfig(self):
- """Tests that config to gn to config is the identity"""
- configs_to_test = {
- "target_os": [None, "android", "chromeos", "linux"],
- "target_arch": [None, "x86", "x64", "arm"],
- "is_debug": [False, True],
- "is_clang": [False, True],
- "sanitizer": [None, Config.SANITIZER_ASAN],
- "use_goma": [False],
- "use_nacl": [False, True],
- }
-
- for args in _iterate_over_config(configs_to_test):
- config = Config(**args)
- gn_args = gn.GNArgsForConfig(config)
- new_config = gn.ConfigForGNArgs(gn_args)
- self.assertDictEqual(config.values, new_config.values)
-
- def testGNToConfigToGN(self):
- """Tests that gn to config to gn is the identity"""
- configs_to_test = {
- "os": [None, "android", "chromeos"],
- "cpu_arch": ["x86", "x64", "arm"],
- "is_debug": [False, True],
- "is_clang": [False, True],
- "is_asan": [False, True],
- "use_goma": [False],
- "mojo_use_nacl": [False, True],
- }
-
- for args in _iterate_over_config(configs_to_test):
- if args.get('os', None) == "chromeos":
- args['use_glib'] = False
- args['use_system_harfbuzz'] = False
- if args.get('os', None) is None and sys.platform[:5] == 'linux':
- args["is_desktop_linux"] = False
- args["use_aura"] = False
- args["use_glib"] = False
- args["use_system_harfbuzz"] = False
- config = gn.ConfigForGNArgs(args)
- new_args = gn.GNArgsForConfig(config)
- self.assertDictEqual(args, new_args)
-
-
-def _iterate_over_config(config):
- def product_to_dict(p):
- return dict(filter(lambda x: x[1] is not None, zip(config.keys(), p)))
- return itertools.imap(product_to_dict, itertools.product(*config.values()))
-
-
-if __name__ == "__main__":
- unittest.main()
« no previous file with comments | « mojo/tools/mopy/gn.py ('k') | mojo/tools/mopy/gtest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698