• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python toolchain.host_toolchain函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中swift_build_support.toolchain.host_toolchain函数的典型用法代码示例。如果您正苦于以下问题:Python host_toolchain函数的具体用法?Python host_toolchain怎么用?Python host_toolchain使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了host_toolchain函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_found_executables_match

    def test_found_executables_match(self):
        # Test that the raw invocation of _first_common_executables
        # either returns None or matching paths.
        suffixes = ['', '-3.8', '-3.7', '-3.6']
        toolchain = host_toolchain(suffixes=suffixes)
        self.assertTrue(len(toolchain.tools) == 2)

        exec_names = {'foo': 'a-tool-that-does-not-exist'}
        toolchain = host_toolchain(tools=exec_names,
                                   suffixes=suffixes)
        self.assertIsNone(toolchain)
开发者ID:0x4d4746h,项目名称:swift,代码行数:11,代码来源:test_toolchain.py


示例2: setUp

    def setUp(self):
        # Setup workspace
        tmpdir1 = os.path.realpath(tempfile.mkdtemp())
        tmpdir2 = os.path.realpath(tempfile.mkdtemp())
        os.makedirs(os.path.join(tmpdir1, 'swift'))

        self.workspace = Workspace(source_root=tmpdir1,
                                   build_root=tmpdir2)

        # Setup toolchain
        self.toolchain = host_toolchain()
        self.toolchain.cc = '/path/to/cc'
        self.toolchain.cxx = '/path/to/cxx'

        # Setup args
        self.args = argparse.Namespace(
            enable_tsan_runtime=False,
            compiler_vendor='none',
            swift_compiler_version=None,
            clang_compiler_version=None,
            swift_user_visible_version=None,
            darwin_deployment_version_osx="10.9",
            benchmark=False,
            benchmark_num_onone_iterations=3,
            benchmark_num_o_iterations=3,
            enable_sil_ownership=False)

        # Setup shell
        shell.dry_run = True
        self._orig_stdout = sys.stdout
        self._orig_stderr = sys.stderr
        self.stdout = StringIO()
        self.stderr = StringIO()
        sys.stdout = self.stdout
        sys.stderr = self.stderr
开发者ID:dgrove-oss,项目名称:swift,代码行数:35,代码来源:test_swift.py


示例3: setUp

    def setUp(self):
        # Setup workspace
        tmpdir1 = os.path.realpath(tempfile.mkdtemp())
        tmpdir2 = os.path.realpath(tempfile.mkdtemp())
        os.makedirs(os.path.join(tmpdir1, "llvm"))

        self.workspace = Workspace(source_root=tmpdir1, build_root=tmpdir2)

        # Setup toolchain
        self.toolchain = host_toolchain()
        self.toolchain.cc = "/path/to/cc"
        self.toolchain.cxx = "/path/to/cxx"

        # Setup args
        self.args = argparse.Namespace(
            llvm_targets_to_build="X86;ARM;AArch64;PowerPC;SystemZ",
            llvm_assertions="true",
            compiler_vendor="none",
            clang_compiler_version=None,
            clang_user_visible_version=None,
            darwin_deployment_version_osx="10.9",
        )

        # Setup shell
        shell.dry_run = True
        self._orig_stdout = sys.stdout
        self._orig_stderr = sys.stderr
        self.stdout = StringIO()
        self.stderr = StringIO()
        sys.stdout = self.stdout
        sys.stderr = self.stderr
开发者ID:Viewtiful,项目名称:swift,代码行数:31,代码来源:test_llvm.py


示例4: setUp

    def setUp(self):
        # Setup workspace
        tmpdir1 = os.path.realpath(tempfile.mkdtemp())
        tmpdir2 = os.path.realpath(tempfile.mkdtemp())
        os.makedirs(os.path.join(tmpdir1, 'ninja'))

        self.workspace = Workspace(source_root=tmpdir1,
                                   build_root=tmpdir2)

        # Setup toolchain
        self.toolchain = host_toolchain()
        self.toolchain.cc = '/path/to/cc'
        self.toolchain.cxx = '/path/to/cxx'

        # Setup args
        self.args = argparse.Namespace(
            build_ninja=True,
            darwin_deployment_version_osx="10.9")

        # Setup shell
        shell.dry_run = True
        self._orig_stdout = sys.stdout
        self._orig_stderr = sys.stderr
        self.stdout = StringIO()
        self.stderr = StringIO()
        sys.stdout = self.stdout
        sys.stderr = self.stderr
开发者ID:007Indian,项目名称:swift,代码行数:27,代码来源:test_ninja.py


示例5: test_tools_suffix_match

    def test_tools_suffix_match(self):
        tc = host_toolchain()

        # CC and CXX must have consistent suffix
        cc_suffix = get_suffix(tc.cc, 'clang')
        cxx_suffix = get_suffix(tc.cxx, 'clang++')
        self.assertEqual(cc_suffix, cxx_suffix)
开发者ID:apple,项目名称:swift,代码行数:7,代码来源:test_toolchain.py


示例6: which_ninja

 def which_ninja(self, args):
     toolchain = host_toolchain()
     if toolchain.ninja is not None:
         return '/path/to/installed/ninja'
     # Maybe we'll build a ninja, maybe we wont.
     # Fake it anyway for the tests.
     return '/path/to/built/ninja'
开发者ID:benlangmuir,项目名称:swift,代码行数:7,代码来源:test_cmake.py


示例7: cmake

 def cmake(self, args):
     """Return new CMake object initialized with given args
     """
     toolchain = host_toolchain()
     toolchain.cc = args.host_cc
     toolchain.cxx = args.host_cxx
     if args.distcc:
         toolchain.distcc = self.mock_distcc_path()
     return CMake(args=args, toolchain=toolchain)
开发者ID:18233135268,项目名称:swift,代码行数:9,代码来源:test_cmake.py


示例8: test_llvm_tools

    def test_llvm_tools(self):
        tc = host_toolchain()

        self.assertTrue(
            tc.llvm_profdata is None or
            os.path.isabs(tc.llvm_profdata) and
            os.path.basename(tc.llvm_profdata).startswith('llvm-profdata'))
        self.assertTrue(
            tc.llvm_cov is None or
            os.path.isabs(tc.llvm_cov) and
            os.path.basename(tc.llvm_cov).startswith('llvm-cov'))
开发者ID:apple,项目名称:swift,代码行数:11,代码来源:test_toolchain.py


示例9: cmake

 def cmake(self, args):
     """Return new CMake object initialized with given args
     """
     toolchain = host_toolchain()
     toolchain.cc = args.host_cc
     toolchain.cxx = args.host_cxx
     if args.distcc:
         toolchain.distcc = self.mock_distcc_path()
     if args.build_ninja:
         toolchain.ninja = '/path/to/built/ninja'
     return CMake(args=args, toolchain=toolchain)
开发者ID:007Indian,项目名称:swift,代码行数:11,代码来源:test_cmake.py


示例10: test_clang_tools

    def test_clang_tools(self):
        tc = host_toolchain()

        self.assertIsNotNone(tc.cc)
        self.assertIsNotNone(tc.cxx)

        self.assertTrue(
            os.path.isabs(tc.cc) and
            os.path.basename(tc.cc).startswith('clang'))
        self.assertTrue(
            os.path.isabs(tc.cxx) and
            os.path.basename(tc.cxx).startswith('clang++'))
开发者ID:apple,项目名称:swift,代码行数:12,代码来源:test_toolchain.py


示例11: test_can_find_llvm_cov

    def test_can_find_llvm_cov(self):
        suffixes = ['', '-3.8', '-3.7', '-3.6']
        exec_names = {'llvm_cov': 'llvm-cov'}
        toolchain = host_toolchain(tools=exec_names, suffixes=suffixes)

        # must have clang, clang++, and llvm-cov
        self.assertTrue(len(toolchain.tools) == 3)

        try:
            toolchain.llvm_cov
        except AttributeError:
            self.fail("toolchain does not have llvm_cov")
开发者ID:0x4d4746h,项目名称:swift,代码行数:12,代码来源:test_toolchain.py


示例12: test_find_tool

    def test_find_tool(self):
        tc = host_toolchain()

        # Toolchain.find_tool(path) can find arbitrary tool in PATH

        sh = tc.find_tool('sh')
        self.assertTrue(sh is not None and
                        os.path.isabs(sh) and
                        os.path.basename(sh) == 'sh')
        tar = tc.find_tool('tar')
        self.assertTrue(tar is not None and
                        os.path.isabs(tar) and
                        os.path.basename(tar) == 'tar')
开发者ID:apple,项目名称:swift,代码行数:13,代码来源:test_toolchain.py


示例13: test_misc_tools

    def test_misc_tools(self):
        tc = host_toolchain()

        # CMake
        self.assertIsNotNone(tc.cmake)
        self.assertTrue(
            os.path.basename(tc.cmake).startswith('cmake'))

        # Ninja
        self.assertTrue(tc.ninja is None or
                        os.path.basename(tc.ninja) == 'ninja' or
                        os.path.basename(tc.ninja) == 'ninja-build')
        # distcc
        self.assertTrue(tc.distcc is None or
                        os.path.basename(tc.distcc) == 'distcc')
        # pump
        self.assertTrue(tc.distcc_pump is None or
                        os.path.basename(tc.distcc_pump) == 'pump' or
                        os.path.basename(tc.distcc_pump) == 'distcc-pump')
开发者ID:apple,项目名称:swift,代码行数:19,代码来源:test_toolchain.py


示例14: test_tools_llvm_suffix

    def test_tools_llvm_suffix(self):
        tc = host_toolchain()

        cov_suffix = None
        profdata_suffix = None
        if tc.llvm_cov:
            cov_suffix = get_suffix(tc.llvm_cov, 'llvm-cov')
        if tc.llvm_profdata:
            profdata_suffix = get_suffix(tc.llvm_profdata, 'llvm-profdata')

        if profdata_suffix is not None and cov_suffix is not None:
            self.assertEqual(profdata_suffix, cov_suffix)

        # If we have suffixed clang, llvm tools must have the same suffix.
        cc_suffix = get_suffix(tc.cc, 'clang')
        if cc_suffix != '':
            if cov_suffix is not None:
                self.assertEqual(cc_suffix, cov_suffix)
            if profdata_suffix is not None:
                self.assertEqual(cc_suffix, profdata_suffix)
开发者ID:apple,项目名称:swift,代码行数:20,代码来源:test_toolchain.py


示例15: noqa

import logging
import os
import pipes
import sys

from multiprocessing import Process


# Allow importing swift_build_support.
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..',
                             'swift_build_support'))
from swift_build_support import shell  # noqa (E402)
from swift_build_support.toolchain import host_toolchain  # noqa (E402)

toolchain = host_toolchain()
LLVM_PROFDATA_PATH = toolchain.llvm_profdata
_profdata_help = shell.capture([LLVM_PROFDATA_PATH, 'merge', '-help'],
                               echo=False)
LLVM_PROFDATA_SUPPORTS_SPARSE = 'sparse' in _profdata_help


class ProfdataMergerProcess(Process):
    def __init__(self, config, file_queue):
        super(ProfdataMergerProcess, self).__init__()
        self.config = config
        self.file_queue = file_queue
        self.filename_buffer = []
        self.profdata_path = os.path.join(config.tmp_dir,
                                          "%s.profdata" % self.name)
        self.profdata_tmp_path = self.profdata_path + ".copy"
开发者ID:kundanjadhav,项目名称:swift,代码行数:30,代码来源:process.py



注:本文中的swift_build_support.toolchain.host_toolchain函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python swift_testing.check_response函数代码示例发布时间:2022-05-27
下一篇:
Python utils.LOGGER类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap