OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
| 5 import datetime |
5 import re | 6 import re |
6 import string | 7 import string |
7 | 8 |
8 | 9 |
9 class Test(object): | 10 class Test(object): |
10 """ | 11 """ |
11 Base class for tests that can be retried after deapplying a previously | 12 Base class for tests that can be retried after deapplying a previously |
12 applied patch. | 13 applied patch. |
13 """ | 14 """ |
14 | 15 |
(...skipping 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1689 @staticmethod | 1690 @staticmethod |
1690 def compile_targets(api): | 1691 def compile_targets(api): |
1691 """List of compile targets needed by this test.""" | 1692 """List of compile targets needed by this test.""" |
1692 return [] | 1693 return [] |
1693 | 1694 |
1694 def run(self, api, suffix, test_filter=None): | 1695 def run(self, api, suffix, test_filter=None): |
1695 api.chromium_android.coverage_report(upload=False) | 1696 api.chromium_android.coverage_report(upload=False) |
1696 api.chromium_android.get_changed_lines_for_revision() | 1697 api.chromium_android.get_changed_lines_for_revision() |
1697 api.chromium_android.incremental_coverage_report() | 1698 api.chromium_android.incremental_coverage_report() |
1698 | 1699 |
| 1700 class FindAnnotatedTest(Test): |
| 1701 _TEST_APKS = { |
| 1702 'android_webview_test_apk': 'AndroidWebViewTest', |
| 1703 'blimp_test_apk': 'BlimpTest', |
| 1704 'chrome_public_test_apk': 'ChromePublicTest', |
| 1705 'chrome_sync_shell_test_apk': 'ChromeSyncShellTest', |
| 1706 'content_shell_test_apk': 'ContentShellTest', |
| 1707 'system_webview_shell_layout_test_apk': 'SystemWebViewShellLayoutTest', |
| 1708 } |
| 1709 |
| 1710 @staticmethod |
| 1711 def compile_targets(api): |
| 1712 return FindAnnotatedTest._TEST_APKS.keys() |
| 1713 |
| 1714 def run(self, api, suffix, test_filter=None): |
| 1715 with api.tempfile.temp_dir('annotated_tests_json') as temp_output_dir: |
| 1716 timestamp_string = datetime.datetime.utcnow().strftime('%Y%m%dT%H%M%S') |
| 1717 if api.properties.get('buildername') is not None: |
| 1718 timestamp_string = api.properties.get('current_time') |
| 1719 |
| 1720 api.python( |
| 1721 'run find_annotated_tests.py', |
| 1722 api.path['checkout'].join( |
| 1723 'tools', 'android', 'find_annotated_tests.py'), |
| 1724 args=[ |
| 1725 '--test-apks', ' '.join(FindAnnotatedTest._TEST_APKS.values()), |
| 1726 '--apk-output-dir', api.chromium.output_dir, |
| 1727 '--json-output-dir', temp_output_dir, |
| 1728 '--timestamp-string', timestamp_string, |
| 1729 '-v']) |
| 1730 api.gsutil.upload( |
| 1731 temp_output_dir.join( |
| 1732 '%s-android-chrome.json' % timestamp_string), |
| 1733 'chromium-annotated-tests', 'android') |
1699 | 1734 |
1700 GOMA_TESTS = [ | 1735 GOMA_TESTS = [ |
1701 GTestTest('base_unittests'), | 1736 GTestTest('base_unittests'), |
1702 GTestTest('content_unittests'), | 1737 GTestTest('content_unittests'), |
1703 ] | 1738 ] |
OLD | NEW |