!2735 [static_core] Fix python scripts codecheck

Merge pull request !2735 from ivagin/abckit-tidy-codecheck-fix
This commit is contained in:
openharmony_ci 2024-10-29 17:03:26 +00:00 committed by Gitee
commit 6c01663648
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 20 additions and 9 deletions

View File

@ -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)

View File

@ -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")