1@REM Copyright (c) 2023 Huawei Device Co., Ltd. 2@REM Licensed under the Apache License, Version 2.0 (the "License"); 3@REM you may not use this file except in compliance with the License. 4@REM You may obtain a copy of the License at 5@REM 6@REM http://www.apache.org/licenses/LICENSE-2.0 7@REM 8@REM Unless required by applicable law or agreed to in writing, software 9@REM distributed under the License is distributed on an "AS IS" BASIS, 10@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11@REM See the License for the specific language governing permissions and 12@REM limitations under the License. 13 14@echo off 15SETLOCAL ENABLEEXTENSIONS 16 17REM change to work directory 18cd /d %~dp0 19 20REM log 21echo "------------------------------------------------" >> log.log 22 23REM get tool 24if not exist .\RKDevTool ( 25python .\get_resource\get_tool.py 26.\RKDevTool\DriverAssitant_v5.1.1\DriverAssitant_v5.1.1\DriverInstall.exe 27del /q .\RKDevTool.zip 28) 29if not exist .\RKDevTool\RKDevTool.exe (goto ToolError) 30 31REM get image & XTS testcases 32set var=D:\AutoXTSTest 33if not exist %var% (md %var%) 34rd /s /q %var%\dayu200_xts 35python .\get_resource\spider.py 36del /q %var%\dayu200_xts.tar.gz 37if not exist %var%\dayu200_xts\suites (goto ResourceError) 38 39REM load image to rk3568 40hdc shell reboot bootloader 41cd RKDevTool 42python ..\autoburn.py 43cd .. 44for /f "tokens=*" %%i in ('hdc list targets') do (set target=%%i) 45if "%var%"=="[Empty]" (goto BurnError) 46 47REM run XTStest 48timeout /t 15 49hdc shell "power-shell setmode 602" 50hdc shell "hilog -Q pidoff" 51for /f "tokens=1,2 delims==" %%i in (running_modules.txt) do ( 52if "%%i"=="modules" set value=%%j 53) 54call %var%\dayu200_xts\suites\acts\run.bat run -l %value% 55 56REM get result 57cd /d %~dp0 58echo "Successfully excute script" >> log.log 59if exist result (rd /s /q result) 60md result 61python get_result.py 62ENDLOCAL 63exit 64 65REM error process 66: ToolError 67echo "Error happens while getting tool" >> log.log 68ENDLOCAL 69exit 70 71: ResourceError 72echo "Error happens while getting dailybuilds resource" >> log.log 73ENDLOCAL 74exit 75 76: BurnError 77echo "Error happens while burnning images" >> log.log 78ENDLOCAL 79exit