Exemplo n.º 1
0
    def testConfigToGNToConfig(self):
        """Tests that config to gn to config is the identity"""
        configs_to_test = {
            "target_os": [None, "android", "linux", "ios"],
            "target_cpu": [None, "x86", "x64", "arm", "arm64"],
            "is_simulator": [False, True],
            "is_debug": [False, True],
            "is_official_build": [False, True],
            "is_clang": [False, True],
            "sanitizer": [None, Config.SANITIZER_ASAN],
            "use_goma": [False],
            "use_nacl": [False, True],
            "mojo_use_go": [False],
            "dcheck_always_on": [False, True],
            "boringssl_path": [""],
        }
        if sys.platform == "darwin":
            configs_to_test["target_os"].remove("linux")

        for args in _iterate_over_config(configs_to_test):
            if args.get("target_os") != "ios" and args["is_simulator"]:
                continue
            config = Config(**args)
            gn_args = gn.GNArgsForConfig(config)
            new_config = gn.ConfigForGNArgs(gn_args)
            self.assertDictEqual(config.values, new_config.values)
Exemplo n.º 2
0
    def testGNToConfigToGN(self):
        """Tests that gn to config to gn is the identity"""
        configs_to_test = {
            "os": [None, "android", "chromeos"],
            "target_arch": ["x86", "x64", "arm"],
            "is_debug": [False, True],
            "is_clang": [False, True],
            "is_asan": [False, True],
            "use_goma": [False],
            "mojo_use_nacl": [False, True],
            "dcheck_always_on": [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)
Exemplo n.º 3
0
    def testGNToConfigToGN(self):
        """Tests that gn to config to gn is the identity"""
        # TODO(vtl): Test OSes other than None (== host?) and "android".
        configs_to_test = {
            "target_os": [None, "android"],
            "target_cpu": ["x86", "x64", "arm"],
            "is_debug": [False, True],
            "is_official_build": [False, True],
            "is_clang": [False, True],
            "is_asan": [False, True],
            "use_goma": [False],
            "mojo_use_nacl": [False, True],
            "mojo_use_go": [False],
            "dcheck_always_on": [False, True],
        }

        for args in _iterate_over_config(configs_to_test):
            if args.get("target_os",
                        None) is None and sys.platform[:5] == "linux":
                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)
Exemplo n.º 4
0
    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)
Exemplo n.º 5
0
    def testGNToConfigToGN(self):
        """Tests that gn to config to gn is the identity"""
        # TODO(vtl): Test OSes other than None (== host?) and "android".
        configs_to_test = {
            "target_os": [None, "android"],
            "target_cpu": ["x86", "x64", "arm"],
            "is_debug": [False, True],
            "is_official_build": [False, True],
            "is_clang": [False, True],
            "is_asan": [False, True],
            "use_goma": [False],
            "mojo_use_nacl": [False, True],
            "mojo_use_go": [False],
            "dcheck_always_on": [False, True],
        }

        for args in _iterate_over_config(configs_to_test):
            config = gn.ConfigForGNArgs(args)
            new_args = gn.GNArgsForConfig(config)
            self.assertDictEqual(args, new_args)