Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: components/cronet/tools/cr_cronet.py

Issue 1843183002: [Cronet] Don't forget EmbeddedTestServer apk when testing with cr_cronet.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """ 6 """
7 cr_cronet.py - cr - like helper tool for cronet developers 7 cr_cronet.py - cr - like helper tool for cronet developers
8 """ 8 """
9 9
10 import argparse 10 import argparse
11 import os 11 import os
12 import sys 12 import sys
13 13
14 14
15 def run(command, extra_options=''): 15 def run(command, extra_options=''):
16 command = command + ' ' + extra_options 16 command = command + ' ' + extra_options
17 print command 17 print command
18 return os.system(command) 18 return os.system(command)
19 19
20 20
21 def build(out_dir, extra_options=''): 21 def build(out_dir, extra_options=''):
22 return run('ninja -C ' + out_dir + ' cronet_test_instrumentation_apk', 22 return run('ninja -C ' + out_dir + ' cronet_test_instrumentation_apk',
23 extra_options) 23 extra_options)
24 24
25 25
26 def install(release_arg): 26 def install(release_arg):
27 return run('build/android/adb_install_apk.py ' + release_arg + \ 27 return run('build/android/adb_install_apk.py ' + release_arg + \
28 ' --apk=CronetTest.apk') 28 ' --apk=CronetTest.apk') or \
xunjieli 2016/04/06 13:10:04 I don't really know Python. Should this be "and" i
pauljensen 2016/04/06 13:12:53 run() returns the return code, so 0 is success, so
xunjieli 2016/04/06 13:14:37 Ah, that makes sense. Thanks.
29 run('build/android/adb_install_apk.py ' + release_arg + \
30 ' --apk=ChromiumNetTestSupport.apk')
29 31
30 32
31 def test(release_arg, extra_options): 33 def test(release_arg, extra_options):
32 return run('build/android/test_runner.py instrumentation '+ \ 34 return run('build/android/test_runner.py instrumentation '+ \
33 release_arg + ' --test-apk=CronetTestInstrumentation' + \ 35 release_arg + ' --test-apk=CronetTestInstrumentation' + \
34 ' --fast-local-dev', 36 ' --fast-local-dev',
35 extra_options) 37 extra_options)
36 38
37 39
38 def debug(extra_options): 40 def debug(extra_options):
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 return install(release_arg) or debug(extra_options) 107 return install(release_arg) or debug(extra_options)
106 if (options.command=='build-debug'): 108 if (options.command=='build-debug'):
107 return build(out_dir) or install(release_arg) or debug(extra_options) 109 return build(out_dir) or install(release_arg) or debug(extra_options)
108 110
109 parser.print_help() 111 parser.print_help()
110 return 1 112 return 1
111 113
112 114
113 if __name__ == '__main__': 115 if __name__ == '__main__':
114 sys.exit(main()) 116 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698