本文整理汇总了Python中common_py.system.executor.Executor.check_run_cmd_output方法的典型用法代码示例。如果您正苦于以下问题:Python Executor.check_run_cmd_output方法的具体用法?Python Executor.check_run_cmd_output怎么用?Python Executor.check_run_cmd_output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common_py.system.executor.Executor
的用法示例。
在下文中一共展示了Executor.check_run_cmd_output方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_cpp
# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd_output [as 别名]
def test_cpp():
test_dir = fs.join(os.path.dirname(__file__), 'test_cpp')
test_cpp = fs.join(test_dir, 'test.cpp')
# Compile test.c and make a static library
print_blue('Compile C++ test module.')
ex.check_run_cmd_output('c++', ['-c', test_cpp, '-o', test_dir + '/test.o'])
ex.check_run_cmd_output('ar', ['-cr', test_dir + '/libtest.a',
test_dir + '/test.o'])
# Generate test_module
print_blue('Generate binding for C++ test module.')
ex.check_run_cmd_output(generator_script, [test_dir, 'c++'])
# Build iotjs
print_blue('Build IoT.js.')
module_dir = fs.join(module_generator_dir, 'output', 'test_cpp_module')
args = [
'--external-module=' + module_dir,
'--cmake-param=-DENABLE_MODULE_TEST_CPP_MODULE=ON',
'--jerry-profile=es2015-subset',
'--clean'
]
ex.check_run_cmd_output(build_script, args)
run_test_js(test_dir)
print_green('C++ test succeeded.')
示例2: __init__
# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd_output [as 别名]
def __init__(self, options):
self._process_pool = multiprocessing.Pool(processes=1)
self.iotjs = fs.abspath(options.iotjs)
self.quiet = options.quiet
self.platform = options.platform
self.timeout = options.timeout
self.valgrind = options.valgrind
self.coverage = options.coverage
self.n_api = options.n_api
self.skip_modules = []
self.results = {}
self._msg_queue = multiprocessing.Queue(1)
if options.skip_modules:
self.skip_modules = options.skip_modules.split(",")
# Process the iotjs build information.
iotjs_output = Executor.check_run_cmd_output(self.iotjs,
[path.BUILD_INFO_PATH])
build_info = json.loads(iotjs_output)
self.builtins = set(build_info["builtins"])
self.features = set(build_info["features"])
self.stability = build_info["stability"]
self.debug = build_info["debug"]
if options.n_api:
build_napi_test_module(self.debug)
示例3: check
# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd_output [as 别名]
def check(self, files):
if not self._clang_format:
return
for file in filter(self.is_checked_by_clang, files):
args = ['-style=file', file]
if self._options and self._options.autoedit:
args.append('-i')
output = ex.check_run_cmd_output(self._clang_format,
args, quiet=True)
if output:
with tempfile.NamedTemporaryFile() as temp:
temp.write(output)
temp.flush() # just to be really safe
self._diff(file, temp.name)
示例4: __init__
# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd_output [as 别名]
def __init__(self, options):
self.iotjs = fs.abspath(options.iotjs)
self.quiet = options.quiet
self.timeout = options.timeout
self.valgrind = options.valgrind
self.coverage = options.coverage
self.skip_modules = []
self.results = {}
if options.skip_modules:
self.skip_modules = options.skip_modules.split(",")
# Process the iotjs build information.
iotjs_output = ex.check_run_cmd_output(self.iotjs,
[path.BUILD_INFO_PATH])
build_info = json.loads(iotjs_output)
self.builtins = build_info["builtins"]
self.stability = build_info["stability"]
# Define own alarm handler to handle timeout.
signal.signal(signal.SIGALRM, alarm_handler)
示例5: run_test_js
# 需要导入模块: from common_py.system.executor import Executor [as 别名]
# 或者: from common_py.system.executor.Executor import check_run_cmd_output [as 别名]
def run_test_js(test_dir):
# Run test.js
print_blue('Run test.js file.')
binary = fs.join(path.BUILD_ROOT, 'x86_64-linux', 'debug', 'bin', 'iotjs')
test_js = fs.join(test_dir, 'test.js')
ex.check_run_cmd_output(binary, [test_js])