Android: fixes emulator support in unit test scripts.

* Catch exception in CheckKVM in case kvm-ok is not available.
* Add abi option for launching emulator.

This patch is contributed by Wu Hengzhi (hengzhix.wu@intel.com).

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/13300002

git-svn-id: http://src.chromium.org/svn/trunk/src/build@193019 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
shouqun.liu@intel.com 2013-04-09 05:40:41 +00:00
Родитель aa5f147971
Коммит d1213999be
4 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -59,8 +59,10 @@ def CheckKVM():
Returns:
True if kvm-ok returns 0 (already enabled)
"""
rc = cmd_helper.RunCmd(['kvm-ok'])
return not rc
try:
return not cmd_helper.RunCmd(['kvm-ok'])
except OSError:
return False
def GetSDK():

Просмотреть файл

@ -122,6 +122,7 @@ def _RunATestSuite(options, suite_name):
if options.use_emulator:
buildbot_emulators = emulator.LaunchEmulators(options.emulator_count,
options.abi,
wait_for_boot=True)
attached_devices = [e.device for e in buildbot_emulators]
elif options.test_device:

Просмотреть файл

@ -213,7 +213,7 @@ class Emulator(object):
'--silent',
'delete',
'avd',
'--name', self.avd,
'--name', self.avd_name,
]
avd_process = subprocess.Popen(args=avd_command,
stdout=subprocess.PIPE,

Просмотреть файл

@ -126,6 +126,8 @@ def AddGTestOptions(option_parser):
option_parser.add_option('--exe', action='store_true',
help='If set, use the exe test runner instead of '
'the APK.')
option_parser.add_option('--abi', default='armeabi-v7a',
help='Platform of emulators to launch.')
def AddCommonInstrumentationOptions(option_parser):