代码拉取完成,页面将自动刷新
# UT二维数组,添加格式如下:
# @(UT截图名,UT命令)
# UT截图名: 用于存储图片的名字,最好用用例含义的英文,方便知道图片的含义
# UT命令:UT的命令,当前位置为oh根目录
$ut_array_oh = @(
@("Check main sreen", "ls -l ~"),
@("Compile Target", "rm -rf out && ./build.sh --product-name rk3568 --build-target arkcompiler/runtime_core:ark_packages --build-target arkcompiler/runtime_core:ark_host_linux_tools_packages"),
@("Test262-1", "rm -rf out && ./build.sh --product-name rk3568 --build-target ark_js_host_linux_tools_packages --build-target ets_frontend_build"),
@("Test262-2", "cd arkcompiler/ets_frontend && python3 test262/run_test262.py --es2022 all --ark-frontend-binary=../../out/rk3568/clang_x64/arkcompiler/ets_frontend/es2abc --ark-frontend=es2panda --product-name=rk3568 --timeout=3000000"),
@("Runtime Core UT-Host", "rm -rf out && ./build.sh --product-name rk3568 --build-target runtime_core_host_unittest --gn-args is_debug=true"),
@("Runtime Core UT-Device", "rm -rf out && ./build.sh --product-name rk3568 --build-target runtime_core_unittest --gn-args is_debug=true"),
@("Fuzz", "rm -rf out && ./build.sh --product-name rk3568 --build-target arkcompiler/runtime_core/tests/fuzztest:fuzztest"),
@("loophole scan 1", "rm -rf out && ./build.sh --product-name rk3568 --build-target arkcompiler/runtime_core/libark_defect_scan_aux/tests/unittest:host_unittest"),
@("loophole scan 2", "cd out/rk3568/clang_x64/tests/unittest/arkcompiler/runtime_core && ./LibArkDefectScanAuxTest"),
@("Verifier UT", "rm -rf out && ./build.sh --product-name rk3568 --build-target arkcompiler/runtime_core:verifier_host_unittest"),
@("Verifier Script", "rm -rf out && ./build.sh --product-name rk3568 --build-target arkcompiler/runtime_core:ark_host_linux_tools_packages && export LD_LIBRARY_PATH=./out/rk3568/clang_x64/arkcompiler/ets_frontend:./out/rk3568/clang_x64/arkcompiler/ets_runtime:./out/rk3568/clang_x64/thirdparty/icu:./out/rk3568/clang_x64/thirdparty/zlib:./prebuilts/clang/ohos/linux-x86_64/llvm/lib && python3 arkcompiler/runtime_core/verifier/tests/verify_sys_hap_abc.py --hap-dir applications/standard/hap --verifier-dir out/rk3568/clang_x64/arkcompiler/runtime_core/"),
@("Disamble-UT", "rm -rf out && ./build.sh --product-name rk3568 --build-target arkcompiler/runtime_core:ark_host_linux_tools_packages"),
@("Ins Check", "rm -rf out && python3 arkcompiler/runtime_core/isa/check_version.py")
)
$ut_array_ark = @(
@("Compile", "rm -rf out && python ark.py x64.release"),
@("UT", "rm -rf out && python ark.py x64.release unittest"),
@("test262", "rm -rf out && python ark.py x64.release test262"),
@("workload", "rm -rf out && python ark.py x64.release workload"),
@("debug version", "rm -rf out && python ark.py x64.debug"),
@("release version", "rm -rf out && python ark.py arm64.release")
)
#==================================================================下面运行逻辑,勿动==========================================================================================
Add-Type -AssemblyName System.Drawing
Add-Type -AssemblyName System.Windows.Forms
#定义截图程序
function Take-Screenshot {
param(
[string]$outputPath
)
# 创建一个新的bitmap,与屏幕的大小相同
$bounds = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds
$bitmap = New-Object System.Drawing.Bitmap $bounds.Width, $bounds.Height
# 创建一个graphics对象来处理bitmap
$graphics = [System.Drawing.Graphics]::FromImage($bitmap)
# 截取整个屏幕
$graphics.CopyFromScreen($bounds.Location, [System.Drawing.Point]::Empty, $bounds.Size)
# 保存图片
$bitmap.Save($outputPath, [System.Drawing.Imaging.ImageFormat]::Png)
# 释放资源
$graphics.Dispose()
$bitmap.Dispose()
}
# 定义序号,用于排序
$global:idx=1
$ssh_conn=$args[0].Trim()
#$ssh_conn="ssh -i ~/.ssh/ut_test "+$ssh_conn
$image_path=$args[1].Trim()
$oh_path=$args[2].Trim()
$ark_path=$args[3].Trim()
function Do-Screenshot {
param(
[string]$utName
)
$image_path=$image_path+"\"+$idx+"-"+$utName+".jpg"
# 等待界面数据稳定
[System.Threading.Thread]::Sleep(1000)
Take-Screenshot -outputPath $image_path
# 等待界面数据稳定
[System.Threading.Thread]::Sleep(1000)
echo $image_path
#clear
$global:idx=$global:idx+1
}
echo "start..."
echo ""
# 执行oh的UT
foreach ($subArray in $ut_array_oh) {
$image_name=$subArray[0]
$image_name="OH-"+$image_name
$cmd=$subArray[1]
$host.UI.RawUI.WindowTitle=""+$idx+" "+$image_name
# 输出信息
echo "start execute: $image_name, $cmd"
echo ""
# 调用远程
ssh -i ~/.ssh/ut_test $ssh_conn "cd "$oh_path" && "$cmd
Do-Screenshot -utName $image_name
}
# 执行ark的UT
foreach ($subArray in $ut_array_ark) {
$image_name=$subArray[0]
$image_name="ARK-"+$image_name
$cmd=$subArray[1]
$host.UI.RawUI.WindowTitle=""+$idx+" "+$image_name
# 输出信息
echo "start execute: $image_name, $cmd"
echo ""
# 调用远程
ssh -i ~/.ssh/ut_test $ssh_conn "cd "$ark_path" && "$cmd
Do-Screenshot -utName $image_name
}
echo ""
echo "end ..."
pause
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。