mirror of
https://gitee.com/openharmony/arkcompiler_runtime_core
synced 2024-11-23 23:00:08 +00:00
!2735 [static_core] Fix python scripts codecheck
Merge pull request !2735 from ivagin/abckit-tidy-codecheck-fix
This commit is contained in:
commit
6c01663648
@ -58,19 +58,30 @@ class ExecRes:
|
||||
self.stderr = stderr
|
||||
|
||||
|
||||
def stress_exec(cmd, cwd=os.getcwd(), allow_error=False, timeout=600, print_output=False, print_command=True, env=None,
|
||||
repeats: int = 1):
|
||||
if print_command:
|
||||
logging.debug('$ {0}> %s', cwd, " ".join(cmd))
|
||||
def stress_exec(cmd, **kwargs):
|
||||
default_kwargs = {
|
||||
'cwd': os.getcwd(),
|
||||
'allow_error': False,
|
||||
'timeout': 600,
|
||||
'print_output': False,
|
||||
'print_command': True,
|
||||
'env': None,
|
||||
'repeats': 1,
|
||||
}
|
||||
kwargs = {**default_kwargs, **kwargs}
|
||||
|
||||
ct = timeout
|
||||
for loop in range(repeats):
|
||||
return_code, stdout, stderr = __exec_impl(cmd, cwd=cwd, timeout=ct, print_output=print_output, env=env)
|
||||
if kwargs['print_command']:
|
||||
logging.debug('$ {0}> %s', kwargs['cwd'], " ".join(cmd))
|
||||
|
||||
ct = kwargs['timeout']
|
||||
for _ in range(kwargs['repeats']):
|
||||
return_code, stdout, stderr = __exec_impl(cmd, cwd=kwargs['cwd'], timeout=ct,
|
||||
print_output=kwargs['print_output'], env=kwargs['env'])
|
||||
if return_code != -1:
|
||||
break
|
||||
ct = ct + 60
|
||||
|
||||
if return_code != 0 and not allow_error:
|
||||
if return_code != 0 and not kwargs['allow_error']:
|
||||
raise Exception(f"Error: Non-zero return code\nstdout: {stdout}\nstderr: {stderr}")
|
||||
return ExecRes(return_code, stdout, stderr)
|
||||
|
||||
|
@ -503,7 +503,7 @@ if __name__ == "__main__":
|
||||
print('clang-tidy proc_count: ' + str(process_count))
|
||||
conf_file_path = arguments.panda_dir
|
||||
if arguments.check_libabckit:
|
||||
conf_file_path += "/libabckit/"
|
||||
conf_file_path = os.path.join(conf_file_path, "libabckit")
|
||||
if not check_file_list(files_list, conf_file_path, arguments.build_dir, arguments.header_filter, process_count):
|
||||
sys.exit("Failed: Clang-tidy get errors")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user