| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 # On Android we build unit test bundles as shared libraries. To run | 6 # On Android we build unit test bundles as shared libraries. To run |
| 7 # tests, we launch a special "test runner" apk which loads the library | 7 # tests, we launch a special "test runner" apk which loads the library |
| 8 # then jumps into it. Since java is required for many tests | 8 # then jumps into it. Since java is required for many tests |
| 9 # (e.g. PathUtils.java), a "pure native" test bundle is inadequate. | 9 # (e.g. PathUtils.java), a "pure native" test bundle is inadequate. |
| 10 # | 10 # |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 def Compile(self, ant_args): | 139 def Compile(self, ant_args): |
| 140 """Build the generated apk with ant. | 140 """Build the generated apk with ant. |
| 141 | 141 |
| 142 Args: | 142 Args: |
| 143 ant_args: extra args to pass to ant | 143 ant_args: extra args to pass to ant |
| 144 """ | 144 """ |
| 145 cmd = ['ant'] | 145 cmd = ['ant'] |
| 146 if ant_args: | 146 if ant_args: |
| 147 cmd.append(ant_args) | 147 cmd.append(ant_args) |
| 148 cmd.append("-DAPP_ABI=" + self._target_abi) |
| 148 cmd.extend(['-buildfile', | 149 cmd.extend(['-buildfile', |
| 149 os.path.join(self._output_directory, 'native_test_apk.xml')]) | 150 os.path.join(self._output_directory, 'native_test_apk.xml')]) |
| 150 logging.warn(cmd) | 151 logging.warn(cmd) |
| 151 p = subprocess.Popen(cmd, stderr=subprocess.STDOUT) | 152 p = subprocess.Popen(cmd, stderr=subprocess.STDOUT) |
| 152 (stdout, _) = p.communicate() | 153 (stdout, _) = p.communicate() |
| 153 logging.warn(stdout) | 154 logging.warn(stdout) |
| 154 if p.returncode != 0: | 155 if p.returncode != 0: |
| 155 logging.error('Ant return code %d', p.returncode) | 156 logging.error('Ant return code %d', p.returncode) |
| 156 sys.exit(p.returncode) | 157 sys.exit(p.returncode) |
| 157 | 158 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 210 |
| 210 if options.ant_compile: | 211 if options.ant_compile: |
| 211 ntag.Compile(options.ant_args) | 212 ntag.Compile(options.ant_args) |
| 212 else: | 213 else: |
| 213 ntag.CompileAndroidMk() | 214 ntag.CompileAndroidMk() |
| 214 | 215 |
| 215 logging.warn('COMPLETE.') | 216 logging.warn('COMPLETE.') |
| 216 | 217 |
| 217 if __name__ == '__main__': | 218 if __name__ == '__main__': |
| 218 sys.exit(main(sys.argv)) | 219 sys.exit(main(sys.argv)) |
| OLD | NEW |