本文整理汇总了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
示例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')
示例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
示例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')
示例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')
示例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')
示例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')
示例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))
示例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)
示例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))
示例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')
示例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')
示例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))
示例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)
示例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)