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


Python Executor.run_cmd方法代码示例

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


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

示例1: run_checktest

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd [as 别名]
def run_checktest(option):
    checktest_quiet = 'yes'
    if os.getenv('TRAVIS') == "true":
        checktest_quiet = 'no'

    # iot.js executable
    iotjs = fs.join(build_root, 'iotjs', 'iotjs')
    fs.chdir(path.PROJECT_ROOT)
    code = ex.run_cmd(iotjs, [path.CHECKTEST_PATH,
                              '--',
                              'quiet='+checktest_quiet])
    if code != 0:
        ex.fail('Failed to pass unit tests')
    if not option.no_check_valgrind:
        code = ex.run_cmd('valgrind', ['--leak-check=full',
                                       '--error-exitcode=5',
                                       '--undef-value-errors=no',
                                       iotjs,
                                       path.CHECKTEST_PATH,
                                       '--',
                                       'quiet='+checktest_quiet])
        if code == 5:
            ex.fail('Failed to pass valgrind test')
        if code != 0:
            ex.fail('Failed to pass unit tests in valgrind environment')
    return True
开发者ID:esevan,项目名称:iotjs,代码行数:28,代码来源:build.py

示例2: run_checktest

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd [as 别名]
def run_checktest(options):
    checktest_quiet = 'yes'
    if os.getenv('TRAVIS') == "true":
        checktest_quiet = 'no'

    # iot.js executable
    iotjs = fs.join(options.build_root, 'bin', 'iotjs')
    build_args = ['--', 'quiet=' + checktest_quiet]
    if options.iotjs_exclude_module:
        skip_module = ','.join(options.iotjs_exclude_module)
        build_args.append('skip-module=' + skip_module)

    # experimental
    if options.experimental:
        build_args.append('experimental=' + 'yes');

    fs.chdir(path.PROJECT_ROOT)
    code = ex.run_cmd(iotjs, [path.CHECKTEST_PATH] + build_args)
    if code != 0:
        ex.fail('Failed to pass unit tests')
    if not options.no_check_valgrind:
        code = ex.run_cmd('valgrind', ['--leak-check=full',
                                       '--error-exitcode=5',
                                       '--undef-value-errors=no',
                                       iotjs,
                                       path.CHECKTEST_PATH] + build_args)
        if code == 5:
            ex.fail('Failed to pass valgrind test')
        if code != 0:
            ex.fail('Failed to pass unit tests in valgrind environment')
开发者ID:LaszloLango,项目名称:iotjs,代码行数:32,代码来源:build.py

示例3: build_nuttx

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd [as 别名]
def build_nuttx(nuttx_root, buildtype):
    fs.chdir(fs.join(nuttx_root, 'nuttx'))
    try:
        code = 0
        if buildtype == "release":
            code = ex.run_cmd('make',
                              ['IOTJS_ROOT_DIR=' + path.PROJECT_ROOT, 'R=1'])
        else:
            code = ex.run_cmd('make',
                              ['IOTJS_ROOT_DIR=' + path.PROJECT_ROOT, 'R=0'])

        if code == 0:
            return True
        else:
            print 'Failed to build nuttx'
            return False
    except OSError as err:
        print 'Failed to build nuttx: %s' % err
        return False
开发者ID:esevan,项目名称:iotjs,代码行数:21,代码来源:precommit.py

示例4: run_checktest

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd [as 别名]
def run_checktest(options):
    # IoT.js executable
    iotjs = fs.join(options.build_root, 'bin', 'iotjs')

    cmd = []
    args = []
    if options.test_driver == "js":
        cmd = iotjs
        args = [path.CHECKTEST_PATH]
        if options.run_test == "quiet":
            args.append('quiet=yes')

        # experimental
        if options.experimental:
            args.append('experimental=yes');
    else:
        cmd = fs.join(path.TOOLS_ROOT, 'testrunner.py')
        args = [iotjs]
        if options.run_test == "quiet":
            args.append('--quiet')


    fs.chdir(path.PROJECT_ROOT)
    code = ex.run_cmd(cmd, args)
    if code != 0:
        ex.fail('Failed to pass unit tests')

    if not options.no_check_valgrind:
        if options.test_driver == "js":
            code = ex.run_cmd('valgrind', ['--leak-check=full',
                                           '--error-exitcode=5',
                                           '--undef-value-errors=no',
                                           cmd] + args)
            if code == 5:
                ex.fail('Failed to pass valgrind test')
            if code != 0:
                ex.fail('Failed to pass unit tests in valgrind environment')
        else:
            code = ex.run_cmd(cmd, ['--valgrind'] + args)
            if code != 0:
                ex.fail('Failed to pass unit tests in valgrind environment')
开发者ID:MoonkiHong,项目名称:iotjs,代码行数:43,代码来源:build.py

示例5: run_checktest

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd [as 别名]
def run_checktest(options):
    # IoT.js executable
    iotjs = fs.join(options.build_root, 'bin', 'iotjs')

    cmd = fs.join(path.TOOLS_ROOT, 'testrunner.py')
    args = [iotjs, "--platform=%s" % options.target_os]

    if options.run_test == "quiet":
        args.append('--quiet')

    if options.n_api:
        args.append('--n-api')

    fs.chdir(path.PROJECT_ROOT)
    code = ex.run_cmd(cmd, args)
    if code != 0:
        ex.fail('Failed to pass unit tests')

    if not options.no_check_valgrind:
        code = ex.run_cmd(cmd, ['--valgrind'] + args)
        if code != 0:
            ex.fail('Failed to pass unit tests in valgrind environment')
开发者ID:Samsung,项目名称:iotjs,代码行数:24,代码来源:build.py

示例6: git_checkout_master

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd [as 别名]
def git_checkout_master():
    return ex.run_cmd('git checkout master')
开发者ID:esevan,项目名称:iotjs,代码行数:4,代码来源:merge.py

示例7: git_rebase_on_master

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd [as 别名]
def git_rebase_on_master():
    return ex.run_cmd('git rebase master')
开发者ID:esevan,项目名称:iotjs,代码行数:4,代码来源:merge.py

示例8: git_checkout_for_merge

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd [as 别名]
def git_checkout_for_merge(fork_name, branch_name):
    merge_branch = get_merge_branch_name(fork_name, branch_name)
    remote_name = get_merge_remote_name(fork_name, branch_name)
    return ex.run_cmd('git checkout -b %s %s/%s'
                      % (merge_branch, remote_name, branch_name))
开发者ID:esevan,项目名称:iotjs,代码行数:7,代码来源:merge.py

示例9: git_fetch_remote

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd [as 别名]
def git_fetch_remote(fork_name, branch_name):
    remote_name = get_merge_remote_name(fork_name, branch_name)
    return ex.run_cmd('git fetch %s' % remote_name)
开发者ID:esevan,项目名称:iotjs,代码行数:5,代码来源:merge.py

示例10: git_add_remote

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd [as 别名]
def git_add_remote(fork_name, branch_name):
    remote_name = get_merge_remote_name(fork_name, branch_name)
    remote_url = get_repo_url(fork_name)
    return ex.run_cmd('git remote add %s %s' % (remote_name, remote_url))
开发者ID:esevan,项目名称:iotjs,代码行数:6,代码来源:merge.py

示例11: git_rebase_origin_master

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd [as 别名]
def git_rebase_origin_master():
    return ex.run_cmd('git rebase origin/master')
开发者ID:esevan,项目名称:iotjs,代码行数:4,代码来源:merge.py

示例12: git_push

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd [as 别名]
def git_push():
    return ex.run_cmd('git push origin master')
开发者ID:esevan,项目名称:iotjs,代码行数:4,代码来源:merge.py

示例13: check_build

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd [as 别名]
def check_build():
    return (ex.run_cmd(BUILD_SCRIPT_DEBUG) or
            ex.run_cmd(BUILD_SCRIPT_RELEASE))
开发者ID:esevan,项目名称:iotjs,代码行数:5,代码来源:merge.py

示例14: git_remove_remote

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd [as 别名]
def git_remove_remote(fork_name, branch_name):
    remote_name = get_merge_remote_name(fork_name, branch_name)
    return ex.run_cmd('git remote remove %s' % remote_name)
开发者ID:esevan,项目名称:iotjs,代码行数:5,代码来源:merge.py

示例15: git_merge

# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import run_cmd [as 别名]
def git_merge(merge_branch):
    return ex.run_cmd('git merge %s' % merge_branch)
开发者ID:esevan,项目名称:iotjs,代码行数:4,代码来源:merge.py


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