OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env 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 """Runs all the native unit tests. | 6 """Runs all the native unit tests. |
7 | 7 |
8 1. Copy over test binary to /data/local on device. | 8 1. Copy over test binary to /data/local on device. |
9 2. Resources: chrome/unit_tests requires resources (chrome.pak and en-US.pak) | 9 2. Resources: chrome/unit_tests requires resources (chrome.pak and en-US.pak) |
10 to be deployed to the device (in /data/local/tmp). | 10 to be deployed to the device (in /data/local/tmp). |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 _TEST_SUITES = ['base_unittests', | 69 _TEST_SUITES = ['base_unittests', |
70 'content_unittests', | 70 'content_unittests', |
71 'gpu_unittests', | 71 'gpu_unittests', |
72 'ipc_tests', | 72 'ipc_tests', |
73 'net_unittests', | 73 'net_unittests', |
74 'sql_unittests', | 74 'sql_unittests', |
75 'sync_unit_tests', | 75 'sync_unit_tests', |
76 'ui_unittests', | 76 'ui_unittests', |
77 ] | 77 ] |
78 | 78 |
79 # Test suites which are build as an APK. This will be replaced by the default | |
80 # list when we start building all suites as APK. | |
81 _APK_TEST_SUITES = ['replaceme', # Test the template apk too. | |
John Grabowski
2012/05/15 23:50:28
u rool
| |
82 'base_unittests', | |
83 'ipc_tests', | |
84 'ui_unittests', | |
85 ] | |
79 | 86 |
80 def FullyQualifiedTestSuites(apk): | 87 def FullyQualifiedTestSuites(apk): |
81 """Return a fully qualified list that represents all known suites. | 88 """Return a fully qualified list that represents all known suites. |
82 | 89 |
83 Args: | 90 Args: |
84 apk: if True, use the apk-based test runner""" | 91 apk: if True, use the apk-based test runner""" |
85 # If not specified, assume the test suites are in out/Release | 92 # If not specified, assume the test suites are in out/Release |
86 test_suite_dir = os.path.abspath(os.path.join(run_tests_helper.CHROME_DIR, | 93 test_suite_dir = os.path.abspath(os.path.join(run_tests_helper.CHROME_DIR, |
87 'out', 'Release')) | 94 'out', 'Release')) |
88 if apk: | 95 if apk: |
89 # out/Release/$SUITE_apk/ChromeNativeTests-debug.apk | 96 # out/Release/$SUITE_apk/$SUITE-debug.apk |
90 suites = [os.path.join(test_suite_dir, | 97 suites = [os.path.join(test_suite_dir, |
91 t + '_apk', | 98 t + '_apk', |
92 'ChromeNativeTests-debug.apk') | 99 t + '-debug.apk') |
93 for t in _TEST_SUITES] | 100 for t in _APK_TEST_SUITES] |
94 else: | 101 else: |
95 suites = [os.path.join(test_suite_dir, t) for t in _TEST_SUITES] | 102 suites = [os.path.join(test_suite_dir, t) for t in _TEST_SUITES] |
96 return suites | 103 return suites |
97 | 104 |
98 | 105 |
99 class TimeProfile(object): | 106 class TimeProfile(object): |
100 """Class for simple profiling of action, with logging of cost.""" | 107 """Class for simple profiling of action, with logging of cost.""" |
101 | 108 |
102 def __init__(self, description): | 109 def __init__(self, description): |
103 self._description = description | 110 self._description = description |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
459 # 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 |
460 # most recent step). | 467 # most recent step). |
461 if options.annotate: | 468 if options.annotate: |
462 return 0 | 469 return 0 |
463 else: | 470 else: |
464 return failed_tests_count | 471 return failed_tests_count |
465 | 472 |
466 | 473 |
467 if __name__ == '__main__': | 474 if __name__ == '__main__': |
468 sys.exit(main(sys.argv)) | 475 sys.exit(main(sys.argv)) |
OLD | NEW |