diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2015-04-15 17:54:31 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2015-04-20 21:38:46 +0800 |
commit | 4c541615568059e3fa3c377833b7ae30365c65d8 (patch) | |
tree | da62be64f77e0398f4ffcdbf644bc1f5620b6fb7 | |
parent | 8290db4a9bdada832810ae190c2378942003319b (diff) |
antutu3: some improvements to make AVC test more stable
Change-Id: Ica287869b7e6640890ffa7488034fe3411d1c5ca
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rwxr-xr-x | antutu3/vc.py | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/antutu3/vc.py b/antutu3/vc.py index 441a1d5..ea8115e 100755 --- a/antutu3/vc.py +++ b/antutu3/vc.py @@ -10,34 +10,48 @@ kwargs1 = {'verbose': False, 'ignoresecuredevice': False} device, serialno = ViewClient.connectToDeviceOrExit(**kwargs1) kwargs2 = {'startviewserver': True, 'forceviewserveruse': False, 'autodump': False, 'ignoreuiautomatorkilled': True, 'compresseddump': False} vc = ViewClient(device, serialno, **kwargs2) -time.sleep(5) -vc.dump(window='-1') + +def dump_always(): + success = False + while not success: + try: + vc.dump() + success = True + except RuntimeError: + print("Got RuntimeError when call vc.dump()") + time.sleep(5) + except ValueError: + print("Got ValueError when call vc.dump()") + time.sleep(5) + # release info and upgrade dialog are not presented # if there is no connection to Internet try: + time.sleep(5) + dump_always() button_cancel = vc.findViewByIdOrRaise("android:id/button2") button_cancel.touch() except ViewNotFoundException: pass try: - vc.dump(window='-1') time.sleep(2) + dump_always() button_ok = vc.findViewByIdOrRaise("com.antutu.ABenchMark:id/button_ok") button_ok.touch() except ViewNotFoundException: pass -time.sleep(2) -vc.dump(window='-1') -button_test = vc.findViewByIdOrRaise("com.antutu.ABenchMark:id/btn_test_now") -button_test.touch() - -#time.sleep(2) -#vc.dump(window='-1') -#button_start_test = vc.findViewByIdOrRaise("com.antutu.ABenchMark:id/button_test") -#button_start_test.touch() +found_test_btn = False +while not found_test_btn: + try: + dump_always() + button_test = vc.findViewByIdOrRaise("com.antutu.ABenchMark:id/btn_test_now") + button_test.touch() + found_test_btn = True + except ViewNotFoundException: + print("Not find com.antutu.ABenchMark:id/btn_test_now yet, continue") finished = False while(not finished): @@ -63,13 +77,13 @@ for index in range(0, 3): device.press('KEYCODE_BACK') time.sleep(2) -vc.dump(window='-1') +dump_always() header = vc.findViewByIdOrRaise("com.antutu.ABenchMark:id/layoutScoresHeader") if not vc.findViewById("com.antutu.ABenchMark:id/layoutScores"): header.touch() time.sleep(2) -vc.dump(window='-1') +dump_always() mem_score = vc.findViewByIdOrRaise("com.antutu.ABenchMark:id/text_mem") cpu_int_score = vc.findViewByIdOrRaise("com.antutu.ABenchMark:id/text_int") cpu_float_score = vc.findViewByIdOrRaise("com.antutu.ABenchMark:id/text_float") @@ -78,7 +92,7 @@ threed_score = vc.findViewByIdOrRaise("com.antutu.ABenchMark:id/text_3d") db_score = vc.findViewByIdOrRaise("com.antutu.ABenchMark:id/text_db") sd_write_score = vc.findViewByIdOrRaise("com.antutu.ABenchMark:id/text_sdw") sd_read_score = vc.findViewByIdOrRaise("com.antutu.ABenchMark:id/text_sdr") -default_unit = 'Inapplicable' +default_unit = 'points' call(['lava-test-case', '"AnTuTu 3.3.2 CPU Integer Score"', '--result', 'pass', '--measurement', cpu_int_score.getText(), '--units', default_unit]) call(['lava-test-case', '"AnTuTu 3.3.2 CPU Float Score"', '--result', 'pass', '--measurement', cpu_float_score.getText(), '--units', default_unit]) |