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: testing/android/generate_native_test.py

Issue 11066094: Nuke unused test code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
« 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/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 # On Android we build unit test bundles as shared libraries. To run 7 # On Android we build unit test bundles as shared libraries. To run
8 # tests, we launch a special "test runner" apk which loads the library 8 # tests, we launch a special "test runner" apk which loads the library
9 # then jumps into it. Since java is required for many tests 9 # then jumps into it. Since java is required for many tests
10 # (e.g. PathUtils.java), a "pure native" test bundle is inadequate. 10 # (e.g. PathUtils.java), a "pure native" test bundle is inadequate.
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 cmd.extend(['-buildfile', 152 cmd.extend(['-buildfile',
153 os.path.join(self._output_directory, 'native_test_apk.xml')]) 153 os.path.join(self._output_directory, 'native_test_apk.xml')])
154 logging.warn(cmd) 154 logging.warn(cmd)
155 p = subprocess.Popen(cmd, stderr=subprocess.STDOUT) 155 p = subprocess.Popen(cmd, stderr=subprocess.STDOUT)
156 (stdout, _) = p.communicate() 156 (stdout, _) = p.communicate()
157 logging.warn(stdout) 157 logging.warn(stdout)
158 if p.returncode != 0: 158 if p.returncode != 0:
159 logging.error('Ant return code %d', p.returncode) 159 logging.error('Ant return code %d', p.returncode)
160 sys.exit(p.returncode) 160 sys.exit(p.returncode)
161 161
162 def CompileAndroidMk(self):
163 """Build the generated apk within Android source tree using Android.mk."""
164 try:
165 import compile_android_mk # pylint: disable=F0401
166 except:
167 raise AssertionError('Not in Android source tree. '
168 'Please use --sdk-build.')
169 compile_android_mk.CompileAndroidMk(self._native_library,
170 self._output_directory)
171
172
173 def main(argv): 162 def main(argv):
174 parser = optparse.OptionParser() 163 parser = optparse.OptionParser()
175 parser.add_option('--verbose', 164 parser.add_option('--verbose',
176 help='Be verbose') 165 help='Be verbose')
177 parser.add_option('--native_library', 166 parser.add_option('--native_library',
178 help='Full name of native shared library test bundle') 167 help='Full name of native shared library test bundle')
179 parser.add_option('--jars', 168 parser.add_option('--jars',
180 help='Space separated list of jars to be included') 169 help='Space separated list of jars to be included')
181 parser.add_option('--output', 170 parser.add_option('--output',
182 help='Output directory for generated files.') 171 help='Output directory for generated files.')
(...skipping 29 matching lines...) Expand all
212 if options.jars: 201 if options.jars:
213 jar_list = options.jars.replace('"', '').split() 202 jar_list = options.jars.replace('"', '').split()
214 203
215 ntag = NativeTestApkGenerator(native_library=options.native_library, 204 ntag = NativeTestApkGenerator(native_library=options.native_library,
216 jars=jar_list, 205 jars=jar_list,
217 strip_binary=options.strip_binary, 206 strip_binary=options.strip_binary,
218 output_directory=options.output, 207 output_directory=options.output,
219 target_abi=options.app_abi) 208 target_abi=options.app_abi)
220 ntag.CreateBundle(options.sdk_build) 209 ntag.CreateBundle(options.sdk_build)
221 210
222 if options.sdk_build: 211 if options.sdk_build:
Yaron 2012/10/10 01:51:33 Just remove the sdk_build option entirely
shashi 2012/10/10 03:41:11 I have removed the use of option in code, but coul
223 ntag.Compile(options.ant_args) 212 ntag.Compile(options.ant_args)
224 else: 213 else:
225 ntag.CompileAndroidMk() 214 raise AssertionError('Not in Android source tree. '
226 215 'Please use --sdk-build.')
227 logging.warn('COMPLETE.') 216 logging.warn('COMPLETE.')
228 217
229 if __name__ == '__main__': 218 if __name__ == '__main__':
230 sys.exit(main(sys.argv)) 219 sys.exit(main(sys.argv))
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