Handle compile build alerts

Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/IAW32C

Signed-off-by: ah <liangahui@h-partners.com>

Change-Id: I15e476695551f8ec0d1a247677e4b8a67f93b2f3
This commit is contained in:
meeting-meeting 2024-10-10 17:42:42 +08:00
parent cf5a4060fd
commit a4893dc21d
3 changed files with 26 additions and 25 deletions

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Copyright (c) 2024 Huawei Device Co., Ltd.

View File

@ -1,15 +1,15 @@
:: Copyright (c) 2024 Huawei Device Co., Ltd.
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
@rem Copyright (c) 2024 Huawei Device Co., Ltd.
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@echo off
setlocal enabledelayedexpansion
@ -22,14 +22,14 @@ setlocal enabledelayedexpansion
@rem Initialize variables
set "device="
set "deviceCount=0"
set "device_count=0"
@rem Check if a device is connected
echo Checking for connected devices...
for /f "delims=" %%i in ('hdc list targets') do (
if not "%%i"=="" (
set "device=%%i"
set /a deviceCount+=1
set /a device_count+=1
)
)
@ -37,19 +37,19 @@ for /f "delims=" %%i in ('hdc list targets') do (
if "%device%"=="[Empty]" (
echo No devices connected. Please connect a device first.
pause
goto :EOF
exit /b
)
@rem Debugging output
echo Device count: %deviceCount%
echo Device count: %device_count%
echo Device connected: %device%
@rem Create target directory if it does not exist
set targetDir=D:\system_haps
if not exist "%targetDir%" (
mkdir "%targetDir%"
echo Created directory %targetDir%
set target_dir=D:\system_haps
if not exist "%target_dir%" (
mkdir "%target_dir%"
echo Created directory %target_dir%
)
@rem Retrieve list of .hap files from the device
@ -61,7 +61,7 @@ for /f "delims=" %%f in (hap_files.txt) do (
if not "%%f"=="" (
set "hapFile=%%f"
echo Pulling file: !hapFile!
hdc file recv "!hapFile!" "%targetDir%"
hdc file recv "!hapFile!" "%target_dir%"
)
)

View File

@ -54,17 +54,17 @@ def verify_file(file_path, ark_verifier_path):
verification_command = ["/usr/bin/time", "-v", ark_verifier_path, "--input_file", file_path]
result = subprocess.run(verification_command, capture_output=True, text=True)
status = 'pass' if result.returncode == 0 else 'fail'
memory_usage = None
user_time_ms = None
for line in result.stderr.splitlines():
if "Maximum resident set size" in line:
memory_usage = line.split(":")[1].strip() + " KB"
memory_usage = f"{line.split(':')[1].strip()} KB"
if "User time (seconds)" in line:
user_time_seconds = float(line.split(":")[1].strip())
user_time_ms = f"{user_time_seconds * 1000:.2f} ms"
file_size = os.path.getsize(file_path)
file_size_str = f"{file_size / 1024:.2f} KB" if file_size < 1024**2 else f"{file_size / 1024**2:.2f} MB"
report = {