当前位置: 首页>>代码示例>>Python>>正文


Python Executor.check_run_cmd方法代码示例

本文整理汇总了Python中common_py.system.executor.Executor.check_run_cmd方法的典型用法代码示例。如果您正苦于以下问题:Python Executor.check_run_cmd方法的具体用法?Python Executor.check_run_cmd怎么用?Python Executor.check_run_cmd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在common_py.system.executor.Executor的用法示例。


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

示例1: configure_trizenrt

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd [as 别名]
def configure_trizenrt(tizenrt_root, buildtype):
    # TODO: handle buildtype (build vs release) for tizenrt build
    tizenrt_tools = fs.join(tizenrt_root, 'os/tools')
    fs.chdir(tizenrt_tools)
    ex.check_run_cmd('./configure.sh', ['artik053/iotjs'])
    fs.chdir('..')
    ex.check_run_cmd('make', ['context'])
开发者ID:drashti304,项目名称:TizenRT,代码行数:9,代码来源:precommit.py

示例2: job_host_darwin

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd [as 别名]
def job_host_darwin():
    for buildtype in BUILDTYPES:
        ex.check_run_cmd('./tools/build.py', [
                         '--run-test=full',
                         '--buildtype=' + buildtype,
                         '--clean',
                         '--profile=test/profiles/host-darwin.profile'])
开发者ID:Samsung,项目名称:iotjs,代码行数:9,代码来源:travis_script.py

示例3: run_make

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd [as 别名]
def run_make(options, build_home, *args):
    make_opt = ['-C', build_home]
    make_opt.extend(args)
    if not options.no_parallel_build:
        make_opt.append('-j')

    ex.check_run_cmd('make', make_opt)
开发者ID:LaszloLango,项目名称:iotjs,代码行数:9,代码来源:build.py

示例4: build_nuttx

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd [as 别名]
def build_nuttx(nuttx_root, buildtype, maketarget):
    fs.chdir(fs.join(nuttx_root, 'nuttx'))
    if buildtype == "release":
        rflag = 'R=1'
    else:
        rflag = 'R=0'
    ex.check_run_cmd('make',
                     [maketarget, 'IOTJS_ROOT_DIR=' + path.PROJECT_ROOT, rflag])
开发者ID:drashti304,项目名称:TizenRT,代码行数:10,代码来源:precommit.py

示例5: setup_tizen_root

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd [as 别名]
def setup_tizen_root(tizen_root):
    if fs.exists(tizen_root):
        fs.chdir(tizen_root)
        ex.check_run_cmd('git', ['pull'])
        fs.chdir(path.PROJECT_ROOT)
    else:
        ex.check_run_cmd('git', ['clone',
            'https://github.com/pmarcinkiew/tizen3.0_rootstrap.git',
            tizen_root])
开发者ID:drashti304,项目名称:TizenRT,代码行数:11,代码来源:precommit.py

示例6: run_docker

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd [as 别名]
def run_docker():
    ex.check_run_cmd('docker', ['pull', DOCKER_TAG])
    ex.check_run_cmd('docker', ['run', '-dit', '--privileged',
                     '--name', DOCKER_NAME, '-v',
                     '%s:%s' % (TRAVIS_BUILD_PATH, DOCKER_IOTJS_PATH),
                     '--add-host', 'test.mosquitto.org:127.0.0.1',
                     '--add-host', 'echo.websocket.org:127.0.0.1',
                     '--add-host', 'httpbin.org:127.0.0.1',
                     DOCKER_TAG])
开发者ID:Samsung,项目名称:iotjs,代码行数:11,代码来源:travis_script.py

示例7: build_napi_test_module

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd [as 别名]
def build_napi_test_module(is_debug):
    node_gyp = fs.join(path.PROJECT_ROOT,
                       'node_modules',
                       '.bin',
                       'node-gyp')

    print('==> Build N-API test module with node-gyp\n')

    project_root = fs.join(path.PROJECT_ROOT, 'test', 'napi')
    debug_cmd = '--debug' if is_debug else '--release'
    Executor.check_run_cmd(node_gyp, ['configure', debug_cmd ,'rebuild'],
                           cwd=project_root)
开发者ID:Samsung,项目名称:iotjs,代码行数:14,代码来源:testrunner.py

示例8: exec_docker

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd [as 别名]
def exec_docker(cwd, cmd, env=[], is_background=False):
    exec_cmd = 'cd %s && ' % cwd + ' '.join(cmd)
    if is_background:
        docker_args = ['exec', '-dit']
    else:
        docker_args = ['exec', '-it']

    for e in env:
        docker_args.append('-e')
        docker_args.append(e)

    docker_args += [DOCKER_NAME, 'bash', '-c', exec_cmd]
    ex.check_run_cmd('docker', docker_args)
开发者ID:Samsung,项目名称:iotjs,代码行数:15,代码来源:travis_script.py

示例9: copy_tiznert_stuff

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd [as 别名]
def copy_tiznert_stuff(tizenrt_root, iotjs_dir):
    tizenrt_iotjsapp_dir = fs.join(tizenrt_root, 'apps/system/iotjs')
    tizenrt_config_dir = fs.join(tizenrt_root, 'build/configs/artik053/iotjs')
    iotjs_tizenrt_appdir = fs.join(iotjs_dir,
                                  'config/tizenrt/artik05x/app')
    iotjs_config_dir = \
        fs.join(iotjs_dir, 'config/tizenrt/artik05x/configs')

    ex.check_run_cmd('cp',
                    ['-rfu', iotjs_tizenrt_appdir, tizenrt_iotjsapp_dir])

    ex.check_run_cmd('cp',
                    ['-rfu', iotjs_config_dir, tizenrt_config_dir])
开发者ID:drashti304,项目名称:TizenRT,代码行数:15,代码来源:precommit.py

示例10: build_tuv

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd [as 别名]
def build_tuv(option):
    # Check if libtuv submodule exists.
    if not fs.exists(path.TUV_ROOT):
        ex.fail('libtuv submodule not exists!')

    # Move working directory to libtuv build directory.
    build_home = fs.join(build_root, 'deps', 'libtuv')
    fs.maybe_make_directory(build_home)
    fs.chdir(build_home)

    # Set tuv cmake option.
    cmake_opt = [path.TUV_ROOT]
    cmake_opt.append('-DCMAKE_TOOLCHAIN_FILE=' +
                     fs.join(path.TUV_ROOT,
                             'cmake', 'config',
                             'config_' + target_tuple + '.cmake'))
    cmake_opt.append('-DCMAKE_BUILD_TYPE=' + option.buildtype)
    cmake_opt.append('-DTARGET_PLATFORM=' + target_tuple)
    cmake_opt.append('-DLIBTUV_CUSTOM_LIB_OUT=' + build_home)
    cmake_opt.append('-DBUILDTESTER=no')
    cmake_opt.append('-DBUILDAPIEMULTESTER=no')

    if option.target_os == 'nuttx':
        cmake_opt.append('-DTARGET_SYSTEMROOT=' + option.nuttx_home)

    if option.target_board:
        cmake_opt.append('-DTARGET_BOARD=' + option.target_board)

    # inflate cmake option.
    inflate_cmake_option(cmake_opt, option)

    # Run cmake
    ex.check_run_cmd('cmake', cmake_opt)

    # Run make
    make_opt = []
    if not option.no_parallel_build:
        make_opt.append('-j')

    ex.check_run_cmd('make', make_opt)

    # libtuv output
    output = fs.join(build_home, 'libtuv.a')
    if not fs.exists(output):
        ex.fail('libtuv build failed - target not produced.')

    # copy output to libs directory
    fs.maybe_make_directory(build_libs)
    fs.copy(output, libtuv_output_path)

    return True
开发者ID:esevan,项目名称:iotjs,代码行数:53,代码来源:build.py

示例11: build_jerry

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd [as 别名]
def build_jerry(option):
    # Check if JerryScript submodule exists.
    if not fs.exists(path.JERRY_ROOT):
        ex.fail('JerryScript submodule not exists!')

    # Move working directory to JerryScript build directory.
    build_home = fs.join(host_build_root, 'deps', 'jerry')
    fs.maybe_make_directory(build_home)
    fs.chdir(build_home)

    # Set JerryScript cmake option.
    cmake_opt = [path.JERRY_ROOT]

    cmake_opt.append('-DCMAKE_TOOLCHAIN_FILE=' + host_cmake_toolchain_file)

    if option.buildtype == 'debug':
        cmake_opt.append('-DCMAKE_BUILD_TYPE=Debug')

    # Turn off LTO for jerry bin to save build time.
    cmake_opt.append('-DENABLE_LTO=OFF')

    # Turn on snapshot
    if not option.no_snapshot:
        cmake_opt.append('-DFEATURE_SNAPSHOT_SAVE=ON')

    # Run cmake.
    ex.check_run_cmd('cmake', cmake_opt)

    target_jerry = {
        'target_name': 'jerry',
        'output_path': fs.join(build_home, 'bin/jerry')
    }

    # Make option.
    make_opt = ['-C', build_home]
    if not option.no_parallel_build:
        make_opt.append('-j')

    # Run make for a target.
    ex.check_run_cmd('make', make_opt)

    # Check output
    output = target_jerry['output_path']
    if not fs.exists(output):
        print output
        ex.fail('JerryScript build failed - target not produced.')

    # copy
    fs.copy(output, jerry_output_path)

    return True
开发者ID:esevan,项目名称:iotjs,代码行数:53,代码来源:build.py

示例12: build_libhttpparser

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd [as 别名]
def build_libhttpparser(option):
    # Check if JerryScript submodule exists.
    if not fs.exists(path.HTTPPARSER_ROOT):
        ex.fail('libhttpparser submodule not exists!')
        return False

    # Move working directory to JerryScript build directory.
    build_home = fs.join(build_root, 'deps', 'httpparser')
    fs.maybe_make_directory(build_home)
    fs.chdir(build_home)

    # Set JerryScript cmake option.
    cmake_opt = [path.HTTPPARSER_ROOT]

    cmake_opt.append('-DCMAKE_TOOLCHAIN_FILE=' + cmake_toolchain_file)
    cmake_opt.append('-DBUILDTYPE=' + option.buildtype.capitalize())

    if option.target_os == 'nuttx':
        cmake_opt.append('-DNUTTX_HOME=' + option.nuttx_home)
        cmake_opt.append('-DOS=NUTTX')
    if option.target_os == 'linux':
        cmake_opt.append('-DOS=LINUX')

    # inflate cmake option.
    inflate_cmake_option(cmake_opt, option)

    # Run cmake.
    ex.check_run_cmd('cmake', cmake_opt)

    # Set make option.
    make_opt = []
    if not option.no_parallel_build:
        make_opt.append('-j')

    # Run make
    ex.check_run_cmd('make', make_opt)

    # Output
    output = fs.join(build_home, 'libhttpparser.a')
    if not fs.exists(output):
            ex.fail('libhttpparser build failed - target not produced.')

    # copy
    fs.copy(output, libhttpparser_output_path)

    return True
开发者ID:esevan,项目名称:iotjs,代码行数:48,代码来源:build.py

示例13: setup_nuttx_root

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd [as 别名]
def setup_nuttx_root(nuttx_root):
    # Step 1
    fs.maybe_make_directory(nuttx_root)
    fs.chdir(nuttx_root)
    if not fs.exists('nuttx'):
        ex.check_run_cmd('git', ['clone',
                                 'https://bitbucket.org/nuttx/nuttx.git'])
    fs.chdir('nuttx')
    ex.check_run_cmd('git', ['checkout', NUTTXTAG])
    fs.chdir('..')

    if not fs.exists('apps'):
        ex.check_run_cmd('git', ['clone',
                                 'https://bitbucket.org/nuttx/apps.git'])
    fs.chdir('apps')
    ex.check_run_cmd('git', ['checkout', NUTTXTAG])
    fs.chdir('..')

    # Step 2
    fs.maybe_make_directory(fs.join(nuttx_root, 'apps', 'system', 'iotjs'))
    for file in fs.listdir(fs.join(path.PROJECT_ROOT,
                                   'config', 'nuttx', 'stm32f4dis','app')):
        fs.copy(fs.join(path.PROJECT_ROOT, 'config',
                        'nuttx', 'stm32f4dis', 'app', file),
                fs.join(nuttx_root, 'apps', 'system', 'iotjs'))

    # Step 3
    fs.chdir(fs.join(nuttx_root, 'nuttx', 'tools'))
    ex.check_run_cmd('./configure.sh', ['stm32f4discovery/usbnsh'])
    fs.chdir('..')
    fs.copy(fs.join(path.PROJECT_ROOT,
                    'config',
                    'nuttx',
                    'stm32f4dis',
                    '.config.travis'),
            '.config')
开发者ID:drashti304,项目名称:TizenRT,代码行数:38,代码来源:precommit.py

示例14: setup_tizenrt_repo

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd [as 别名]
def setup_tizenrt_repo(tizenrt_root):
    if fs.exists(tizenrt_root):
        fs.chdir(tizenrt_root)
        ex.check_run_cmd('git', ['fetch', 'origin'])
        fs.chdir(path.PROJECT_ROOT)
    else:
        ex.check_run_cmd('git', ['clone',
            'https://github.com/Samsung/TizenRT.git',
            tizenrt_root])
    ex.check_run_cmd('git', ['--git-dir', tizenrt_root + '/.git/',
                             '--work-tree', tizenrt_root,
                             'checkout', TIZENRT_COMMIT])
    copy_tiznert_stuff(tizenrt_root, path.PROJECT_ROOT)
开发者ID:drashti304,项目名称:TizenRT,代码行数:15,代码来源:precommit.py

示例15: build_libjerry

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd [as 别名]
def build_libjerry(option):
    # Check if JerryScript submodule exists.
    if not fs.exists(path.JERRY_ROOT):
        ex.fail('JerryScript submodule not exists!')

    # Move working directory to JerryScript build directory.
    build_home = fs.join(build_root, 'deps', 'jerry')
    fs.maybe_make_directory(build_home)
    fs.chdir(build_home)

    # Set JerryScript cmake option.
    cmake_opt = [path.JERRY_ROOT]

    cmake_opt.append('-DCMAKE_TOOLCHAIN_FILE=' + cmake_toolchain_file)

    if option.buildtype == 'debug':
        cmake_opt.append('-DCMAKE_BUILD_TYPE=Debug')
        cmake_opt.append('-DFEATURE_ERROR_MESSAGES=On')

    if option.target_os == 'nuttx':
        cmake_opt.append('-DEXTERNAL_LIBC_INTERFACE=' +
                         fs.join(option.nuttx_home, 'include'))
        if option.target_arch == 'arm':
            cmake_opt.append('-DEXTERNAL_CMAKE_SYSTEM_PROCESSOR=arm')

    if option.target_os == 'linux':
        cmake_opt.append('-DJERRY_LIBC=OFF')
        cmake_opt.append('-DJERRY_LIBM=OFF')

    # --jerry-heaplimit
    if option.jerry_heaplimit:
        cmake_opt.append('-DMEM_HEAP_SIZE_KB=' +
                         str(option.jerry_heaplimit))

    # --jerry-heap-section
    if option.jerry_heap_section:
        cmake_opt.append('-DJERRY_HEAP_SECTION_ATTR=' +
                         str(option.jerry_heap_section))

    # --jerry-lto
    cmake_opt.append('-DENABLE_LTO=%s' % ('ON' if option.jerry_lto else 'OFF'))

    if option.jerry_memstat:
        cmake_opt.append('-DFEATURE_MEM_STATS=ON')

    # Turn on snapshot
    cmake_opt.append('-DFEATURE_SNAPSHOT_SAVE=OFF')
    if not option.no_snapshot:
        cmake_opt.append('-DFEATURE_SNAPSHOT_EXEC=ON')

    # --jerry-cmake-param
    cmake_opt += option.jerry_cmake_param

    # inflate cmake option.
    inflate_cmake_option(cmake_opt, option, for_jerry=True)

    # Run cmake.
    ex.check_run_cmd('cmake', cmake_opt)

    # make target - libjerry
    target_libjerry_name = 'jerry-core'
    target_libjerry = {
        'target_name': target_libjerry_name,
        'output_path': fs.join(build_home, 'lib',
                               'lib%s.a' % target_libjerry_name),
        'dest_path': libjerry_output_path
    }

    targets = []
    targets.append(target_libjerry)

    # make the target.
    for target in targets:
        # Make option.
        make_opt = ['-C', build_home, target['target_name']]
        if not option.no_parallel_build:
            make_opt.append('-j')

        # Run make for a target.
        ex.check_run_cmd('make', make_opt)

        # Check output
        output = target['output_path']
        if not fs.exists(output):
            print output
            ex.fail('JerryScript build failed - target not produced.')

        # copy
        fs.copy(output, target['dest_path'])

    return True
开发者ID:esevan,项目名称:iotjs,代码行数:93,代码来源:build.py


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