2012-08-29 18:23:46 +08:00
|
|
|
::This script is used to accomplish a android automated compiler.
|
|
|
|
::You should make sure have accomplished the environment setting.
|
|
|
|
::You should add %ANDROID_HOME%\tools and %ANDROID_HOME%\platform-tools to the environment variable of Path.
|
2012-08-22 11:08:18 +08:00
|
|
|
|
2012-08-29 18:23:46 +08:00
|
|
|
::Copy monkeyrunner python script to android sdk tools directory.
|
2012-08-23 17:21:11 +08:00
|
|
|
cd ..\..
|
2012-08-29 18:23:46 +08:00
|
|
|
copy %cd%\Monkeyrunner_TestCpp.py %ANDROID_HOME%\tools
|
|
|
|
copy %cd%\ReportManager.py %ANDROID_HOME%\tools
|
2012-08-22 11:08:18 +08:00
|
|
|
|
2012-08-23 17:21:11 +08:00
|
|
|
cd ..\..
|
2012-08-29 18:23:46 +08:00
|
|
|
set PROJECT_HOME=%cd%
|
2012-08-22 11:08:18 +08:00
|
|
|
cd samples\TestCpp\proj.android\bin
|
|
|
|
|
2012-08-29 18:23:46 +08:00
|
|
|
::Copy test apk to android sdk tools directory.
|
2012-08-24 10:23:00 +08:00
|
|
|
copy %cd%\TestCpp-release-8.apk %ANDROID_HOME%\tools
|
|
|
|
copy %cd%\TestCpp-release-10.apk %ANDROID_HOME%\tools
|
|
|
|
copy %cd%\TestCpp-release-11.apk %ANDROID_HOME%\tools
|
|
|
|
copy %cd%\TestCpp-release-12.apk %ANDROID_HOME%\tools
|
|
|
|
copy %cd%\TestCpp-release-13.apk %ANDROID_HOME%\tools
|
2012-08-22 11:08:18 +08:00
|
|
|
|
2012-08-29 18:23:46 +08:00
|
|
|
::Enter android sdk tools directory.
|
2012-08-22 11:08:18 +08:00
|
|
|
set ANDROID_ROOT=%ANDROID_HOME:~0,2%
|
|
|
|
%ANDROID_ROOT%
|
|
|
|
cd %ANDROID_HOME%\tools
|
|
|
|
|
|
|
|
::If monkeyrunner test failed,it automatically exit and make ERRORLEVEL nonzero.
|
|
|
|
|
|
|
|
::Running monkeyrunner test(release,API level:8).
|
2012-08-24 10:23:00 +08:00
|
|
|
ren TestCpp-release-8.apk TestCpp-release.apk
|
2012-08-29 18:23:46 +08:00
|
|
|
call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk
|
|
|
|
if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1
|
2012-08-24 10:23:00 +08:00
|
|
|
rm TestCpp-release.apk
|
2012-08-22 11:08:18 +08:00
|
|
|
|
|
|
|
::Running monkeyrunner test(release,API level:10).
|
2012-08-24 10:23:00 +08:00
|
|
|
ren TestCpp-release-10.apk TestCpp-release.apk
|
2012-08-29 18:23:46 +08:00
|
|
|
call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk
|
|
|
|
if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1
|
2012-08-24 10:23:00 +08:00
|
|
|
rm TestCpp-release.apk
|
2012-08-22 11:08:18 +08:00
|
|
|
|
|
|
|
::Running monkeyrunner test(release,API level:11).
|
2012-08-24 10:23:00 +08:00
|
|
|
ren TestCpp-release-11.apk TestCpp-release.apk
|
2012-08-29 18:23:46 +08:00
|
|
|
call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk
|
|
|
|
if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1
|
2012-08-24 10:23:00 +08:00
|
|
|
rm TestCpp-release.apk
|
2012-08-22 11:08:18 +08:00
|
|
|
|
|
|
|
::Running monkeyrunner test(release,API level:12).
|
2012-08-24 10:23:00 +08:00
|
|
|
ren TestCpp-release-12.apk TestCpp-release.apk
|
2012-08-29 18:23:46 +08:00
|
|
|
call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk
|
|
|
|
if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1
|
2012-08-24 10:23:00 +08:00
|
|
|
rm TestCpp-release.apk
|
2012-08-22 11:08:18 +08:00
|
|
|
|
|
|
|
::Running monkeyrunner test(release,API level:13).
|
2012-08-24 10:23:00 +08:00
|
|
|
ren TestCpp-release-13.apk TestCpp-release.apk
|
2012-08-29 18:23:46 +08:00
|
|
|
call monkeyrunner Monkeyrunner_TestCpp.py TestCpp-release.apk
|
|
|
|
if %ERRORLEVEL% NEQ 0 call python ReportManager.py && exit 1
|
2012-08-24 10:23:00 +08:00
|
|
|
rm TestCpp-release.apk
|
2012-08-22 11:08:18 +08:00
|
|
|
|
|
|
|
rm Monkeyrunner_TestCpp.py
|
2012-08-29 18:23:46 +08:00
|
|
|
rm ReportManager.py
|
2012-08-22 11:08:18 +08:00
|
|
|
|
|
|
|
::Monkeyrunner success!
|
|
|
|
echo Monkeyrunner Test Success!
|
2012-08-29 18:23:46 +08:00
|
|
|
|
|
|
|
::Clean project files.
|
|
|
|
set PROJECT_ROOT=%PROJECT_HOME:~0,2%
|
|
|
|
%PROJECT_ROOT%
|
|
|
|
cd %PROJECT_HOME%
|
|
|
|
|
2012-08-22 11:08:18 +08:00
|
|
|
git checkout -f
|
|
|
|
git clean -df -x
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
::End
|