Merge lp:~liuyq0307/lava-android-test/v8-skia into lp:lava-android-test

Proposed by Yongqin Liu
Status: Merged
Merged at revision: 231
Proposed branch: lp:~liuyq0307/lava-android-test/v8-skia
Merge into: lp:lava-android-test
Diff against target: 122 lines (+40/-14)
4 files modified
lava_android_test/test_definitions/0xbench.py (+8/-5)
lava_android_test/test_definitions/android-0xbenchmark/android_0xbenchmark_wait.py (+18/-4)
lava_android_test/test_definitions/skia.py (+7/-4)
lava_android_test/test_definitions/v8.py (+7/-1)
To merge this branch: bzr merge lp:~liuyq0307/lava-android-test/v8-skia
Reviewer Review Type Date Requested Status
Andy Doan (community) Approve
Review via email: mp+144221@code.launchpad.net

Description of the change

update v8 and skia test

v8: change to use d8 command in case there is no v8shell command.
    because the v8shell command is change to d8 form JB version

skia: add option for the time parameter, so that we can pass this number
    from android build page to make it not spend too much time

To post a comment you must log in.
233. By Yongqin Liu

update 0xbench to accept specified option from android-build page

1. test to be run can be specified as "--ez <test> true", where "<test>"
   can be math/2d/3d/vm/native
2. the time for waiting finish can be specified from android-build
   as option like "-t 3600", but this must be specified with the test to be run,
   otherwise there will be no test to run automatically

234. By Yongqin Liu

fix the problem of timeout option -t

1. -t is accepted by am start command, so we changed to use -timeout
2. pass the $OPTIONS to android_0xbenchmark_wait.py

Revision history for this message
Yongqin Liu (liuyq0307) wrote :

Also add modification for 0xbench test:

update 0xbench to accept specified option from android-build page

1. test to be run can be specified as "--ez <test> true", where "<test>"
   can be math/2d/3d/vm/native
2. the time for waiting finish can be specified from android-build
   as option like "-timeout 3600", but this must be specified with the test to be run,
   otherwise there will be no test to run automatically

235. By Yongqin Liu

adjust --ez autorun true to the begin of the am comand

Revision history for this message
Andy Doan (doanac) wrote :

v8.py has:

154 -ADB_SHELL_STEPS = ['"cd /data/benchmark/v8; v8shell run.js"']
155 +adb_shell = ('"'
156 + 'cd /data/benchmark/v8;'
157 + 'if which v8shell 2>/dev/null 1>/dev/null;'
158 + 'then v8shell run.js; '
159 + 'else d8 run.js; fi'
160 + '"')
161 +ADB_SHELL_STEPS = [adb_shell]

that's a little awkward, since shell steps can be an array this could be broken up into multiple strings

Revision history for this message
Yongqin Liu (liuyq0307) wrote :

> v8.py has:
>
> 154 -ADB_SHELL_STEPS = ['"cd /data/benchmark/v8; v8shell run.js"']
> 155 +adb_shell = ('"'
> 156 + 'cd /data/benchmark/v8;'
> 157 + 'if which v8shell 2>/dev/null 1>/dev/null;'
> 158 + 'then v8shell run.js; '
> 159 + 'else d8 run.js; fi'
> 160 + '"')
> 161 +ADB_SHELL_STEPS = [adb_shell]
>
> that's a little awkward,
Yes, I know this is not good.
but we need all the shell steps in one string.
then we can run it as adb shell "shell steps".
if we change it to ADB_SHELL_STEPS = [steps1, steps2,..], this will not work.

> since shell steps can be an array this could be
> broken up into multiple strings
sorry, not understand clearly here.
in which case it will be broken up?

236. By Yongqin Liu

revert the change on lava_android_test/provider.py

Revision history for this message
Andy Doan (doanac) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava_android_test/test_definitions/0xbench.py'
2--- lava_android_test/test_definitions/0xbench.py 2012-06-25 17:23:05 +0000
3+++ lava_android_test/test_definitions/0xbench.py 2013-01-22 16:33:27 +0000
4@@ -34,6 +34,9 @@
5
6 curdir = os.path.realpath(os.path.dirname(__file__))
7
8+# "-timeout timeout" must be specified with at least one test
9+# can not only specified the "-timeout timeout" as option
10+DEFAULT_OPTIONS = '--ez math true --ez 2d true --ez 3d true --ez vm true'
11 INSTALL_STEPS_HOST_POST = [
12 ("python %s/android-0xbenchmark/android_0xbenchmark_modify_path.py"
13 " $(SERIAL)") % curdir]
14@@ -43,11 +46,10 @@
15 " $(SERIAL)") % curdir]
16 RUN_STEPS_ADB_SHELL = ['logcat -c',
17 ("am start -n org.zeroxlab.zeroxbenchmark/"
18- "org.zeroxlab.zeroxbenchmark.Benchmark --ez math true"
19- " --ez 2d true --ez 3d true --ez vm true --ez autorun true")]
20+ "org.zeroxlab.zeroxbenchmark.Benchmark --ez autorun true $(OPTIONS)")]
21 RUN_STEPS_HOST_POST = [
22- 'python %s/android-0xbenchmark/android_0xbenchmark_wait.py $(SERIAL)' %
23- curdir]
24+ 'python %s/android-0xbenchmark/android_0xbenchmark_wait.py '
25+ '$(SERIAL) $(OPTIONS)' % curdir]
26
27
28 class ZeroXBenchmarkTestParser(lava_android_test.testdef.AndroidTestParser):
29@@ -82,4 +84,5 @@
30 parser = ZeroXBenchmarkTestParser()
31 testobj = lava_android_test.testdef.AndroidTest(testname="0xbench",
32 installer=inst, runner=run, parser=parser,
33- org_ouput_file=os.path.join(save_dir, '0xBenchmark.bundle'))
34+ org_ouput_file=os.path.join(save_dir, '0xBenchmark.bundle'),
35+ default_options=DEFAULT_OPTIONS)
36
37=== modified file 'lava_android_test/test_definitions/android-0xbenchmark/android_0xbenchmark_wait.py'
38--- lava_android_test/test_definitions/android-0xbenchmark/android_0xbenchmark_wait.py 2012-06-16 13:36:48 +0000
39+++ lava_android_test/test_definitions/android-0xbenchmark/android_0xbenchmark_wait.py 2013-01-22 16:33:27 +0000
40@@ -24,15 +24,29 @@
41
42 from lava_android_test.utils import stop_at_pattern
43
44-if len(sys.argv) == 1:
45- adb_cmd = "adb"
46-else:
47+adb_cmd = "adb"
48+# here assumes that there is no serial number will start with '-'
49+# and the options passed are start with '-' as first option
50+if len(sys.argv) > 1 and (not sys.argv[1].startswith('-')):
51 adb_cmd = "adb -s %s" % (sys.argv[1])
52
53+timeout = 2400
54+for index in range(1, len(sys.argv)):
55+ arg = sys.argv[index]
56+ if arg == '-timeout' and \
57+ (index + 1 < len(sys.argv)) and \
58+ sys.argv[index + 1]:
59+ try:
60+ timeout = int(sys.argv[index + 1])
61+ except ValueError:
62+ pass
63+ finally:
64+ break
65+
66 logcat_cmd = '%s logcat' % (adb_cmd)
67 pattern = "Displayed org.zeroxlab.zeroxbenchmark/.Report"
68
69-if not stop_at_pattern(command=logcat_cmd, pattern=pattern, timeout=2400):
70+if not stop_at_pattern(command=logcat_cmd, pattern=pattern, timeout=timeout):
71 print "0xbench Test: TIMEOUT Fail"
72 sys.exit(1)
73
74
75=== modified file 'lava_android_test/test_definitions/skia.py'
76--- lava_android_test/test_definitions/skia.py 2012-06-28 09:52:29 +0000
77+++ lava_android_test/test_definitions/skia.py 2013-01-22 16:33:27 +0000
78@@ -31,13 +31,15 @@
79
80 test_name = 'skia'
81
82+DEFAULT_OPTIONS = '1000'
83+
84 INSTALL_STEPS_ADB_PRE = []
85 # Skia can do many more benchmarks, but it becomes almost too much data
86 # to make a nice chart for. The -match limits the ones we run
87 ADB_SHELL_STEPS = ['logcat -c',
88- 'skia_bench -repeat 1000 -timers w -config 565 -match bitmap',
89- 'skia_bench -repeat 1000 -timers w -config 565 -match rects',
90- 'skia_bench -repeat 1000 -timers w -config 565 -match repeat',
91+ 'skia_bench -repeat $(OPTIONS) -timers w -config 565 -match bitmap',
92+ 'skia_bench -repeat $(OPTIONS) -timers w -config 565 -match rects',
93+ 'skia_bench -repeat $(OPTIONS) -timers w -config 565 -match repeat',
94 'logcat -d -s "skia:*"']
95
96
97@@ -83,4 +85,5 @@
98 testobj = lava_android_test.testdef.AndroidTest(testname=test_name,
99 installer=inst,
100 runner=run,
101- parser=parser)
102+ parser=parser,
103+ default_options=DEFAULT_OPTIONS)
104
105=== modified file 'lava_android_test/test_definitions/v8.py'
106--- lava_android_test/test_definitions/v8.py 2012-06-25 17:37:01 +0000
107+++ lava_android_test/test_definitions/v8.py 2013-01-22 16:33:27 +0000
108@@ -33,7 +33,13 @@
109 test_name = 'v8'
110
111 INSTALL_STEPS_ADB_PRE = []
112-ADB_SHELL_STEPS = ['"cd /data/benchmark/v8; v8shell run.js"']
113+adb_shell = ('"'
114+ 'cd /data/benchmark/v8;'
115+ 'if which v8shell 2>/dev/null 1>/dev/null;'
116+ 'then v8shell run.js; '
117+ 'else d8 run.js; fi'
118+ '"')
119+ADB_SHELL_STEPS = [adb_shell]
120 PATTERN = "^(?P<test_case_id>.*?):\s+(?P<measurement>\d+)\s*$"
121
122 inst = lava_android_test.testdef.AndroidTestInstaller(

Subscribers

People subscribed via source and target branches