OLD | NEW |
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 """Runs all the native unit tests. | 7 """Runs all the native unit tests. |
8 | 8 |
9 1. Copy over test binary to /data/local on device. | 9 1. Copy over test binary to /data/local on device. |
10 2. Resources: chrome/unit_tests requires resources (chrome.pak and en-US.pak) | 10 2. Resources: chrome/unit_tests requires resources (chrome.pak and en-US.pak) |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 annotate: should we print buildbot-style annotations? | 190 annotate: should we print buildbot-style annotations? |
191 | 191 |
192 Returns: | 192 Returns: |
193 A TestResults object. | 193 A TestResults object. |
194 """ | 194 """ |
195 results = [] | 195 results = [] |
196 global _TEST_SUITES | 196 global _TEST_SUITES |
197 | 197 |
198 if test_suite: | 198 if test_suite: |
199 global _TEST_SUITES | 199 global _TEST_SUITES |
| 200 |
| 201 # If not specified, assume the test suites are in out/Release |
| 202 test_suite_dir = os.path.abspath(os.path.join(run_tests_helper.CHROME_DIR, |
| 203 'out', 'Release')) |
| 204 if apk: |
| 205 # out/Release/$SUITE_apk/$SUITE-debug.apk |
| 206 test_suite = os.path.join(test_suite_dir, |
| 207 test_suite + '_apk', |
| 208 test_suite + '-debug.apk') |
| 209 else: |
| 210 test_suite = os.path.join(test_suite_dir, test_suite) |
| 211 |
200 if (not os.path.exists(test_suite)): | 212 if (not os.path.exists(test_suite)): |
201 logging.critical('Unrecognized test suite %s, supported: %s' % | 213 logging.critical('Unrecognized test suite %s, supported: %s' % |
202 (test_suite, _TEST_SUITES)) | 214 (test_suite, _TEST_SUITES)) |
203 if test_suite in _TEST_SUITES: | 215 if test_suite in _TEST_SUITES: |
204 logging.critical('(Remember to include the path: out/Release/%s)', | 216 logging.critical('(Remember to include the path: out/Release/%s)', |
205 test_suite) | 217 test_suite) |
206 test_suite_basename = os.path.basename(test_suite) | 218 test_suite_basename = os.path.basename(test_suite) |
207 if test_suite_basename in _TEST_SUITES: | 219 if test_suite_basename in _TEST_SUITES: |
208 logging.critical('Try "make -j15 %s"' % test_suite_basename) | 220 logging.critical('Try "make -j15 %s"' % test_suite_basename) |
209 else: | 221 else: |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 # from all suites, but the buildbot associates the exit status only with the | 498 # from all suites, but the buildbot associates the exit status only with the |
487 # most recent step). | 499 # most recent step). |
488 if options.annotate: | 500 if options.annotate: |
489 return 0 | 501 return 0 |
490 else: | 502 else: |
491 return failed_tests_count | 503 return failed_tests_count |
492 | 504 |
493 | 505 |
494 if __name__ == '__main__': | 506 if __name__ == '__main__': |
495 sys.exit(main(sys.argv)) | 507 sys.exit(main(sys.argv)) |
OLD | NEW |