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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
110 qualified_test_suites = [os.path.join(test_suite_dir, | 110 qualified_test_suites = [os.path.join(test_suite_dir, |
111 t + '_apk', | 111 t + '_apk', |
112 t + '-debug.apk') | 112 t + '-debug.apk') |
113 for t in all_test_suites] | 113 for t in all_test_suites] |
114 for t, q in zip(all_test_suites, qualified_test_suites): | 114 for t, q in zip(all_test_suites, qualified_test_suites): |
115 if not os.path.exists(q): | 115 if not os.path.exists(q): |
116 logging.critical('Test suite %s not found in %s.\n' | 116 logging.critical('Test suite %s not found in %s.\n' |
117 'Supported test suites:\n %s\n' | 117 'Supported test suites:\n %s\n' |
118 'Ensure it has been built.\n', | 118 'Ensure it has been built.\n', |
119 t, q, _TEST_SUITES) | 119 t, q, _TEST_SUITES) |
120 return [] | 120 sys.exit(1) |
Isaac (away)
2012/11/30 22:53:52
lets raise an exception instead of calling sys.exi
frankf
2012/11/30 23:02:00
Done.
On 2012/11/30 22:53:52, Isaac wrote:
| |
121 return qualified_test_suites | 121 return qualified_test_suites |
122 | 122 |
123 | 123 |
124 class TimeProfile(object): | 124 class TimeProfile(object): |
125 """Class for simple profiling of action, with logging of cost.""" | 125 """Class for simple profiling of action, with logging of cost.""" |
126 | 126 |
127 def __init__(self, description): | 127 def __init__(self, description): |
128 self._description = description | 128 self._description = description |
129 self.Start() | 129 self.Start() |
130 | 130 |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
465 # the batch (this happens because the exit status is a sum of all failures | 465 # the batch (this happens because the exit status is a sum of all failures |
466 # from all suites, but the buildbot associates the exit status only with the | 466 # from all suites, but the buildbot associates the exit status only with the |
467 # most recent step). | 467 # most recent step). |
468 if options.exit_code: | 468 if options.exit_code: |
469 return failed_tests_count | 469 return failed_tests_count |
470 return 0 | 470 return 0 |
471 | 471 |
472 | 472 |
473 if __name__ == '__main__': | 473 if __name__ == '__main__': |
474 sys.exit(main(sys.argv)) | 474 sys.exit(main(sys.argv)) |
OLD | NEW |