Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: build/android/pylib/gtest/gtest_test_instance.py

Issue 788753002: [Android] Implement gtest and local in platform mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 logging 5 import logging
6 import os 6 import os
7 import shutil 7 import shutil
8 import sys 8 import sys
9 9
10 from pylib import constants 10 from pylib import constants
(...skipping 20 matching lines...) Expand all
31 'chrome/test/data/safari_import', 31 'chrome/test/data/safari_import',
32 'chrome/test/data/scroll', 32 'chrome/test/data/scroll',
33 'chrome/test/data/third_party', 33 'chrome/test/data/third_party',
34 'third_party/hunspell_dictionaries/*.dic', 34 'third_party/hunspell_dictionaries/*.dic',
35 # crbug.com/258690 35 # crbug.com/258690
36 'webkit/data/bmp_decoder', 36 'webkit/data/bmp_decoder',
37 'webkit/data/ico_decoder', 37 'webkit/data/ico_decoder',
38 ] 38 ]
39 39
40 40
41 # TODO(jbudorick): Make this a classmethod of GtestTestInstance once
klundberg 2014/12/09 02:30:47 s/classmethod/class method
jbudorick 2014/12/09 15:46:51 Done.
42 # test_package_apk and test_package_exe are gone.
43 def ParseGTestListTests(raw_list):
44 """Parses a raw test list as provided by --gtest_list_tests.
45
46 Args:
47 raw_list: The raw test listing with the following format:
48
49 IPCChannelTest.
50 SendMessageInChannelConnected
51 IPCSyncChannelTest.
52 Simple
53 DISABLED_SendWithTimeoutMixedOKAndTimeout
54
55 Returns:
56 A list of all tests. For the above raw listing:
57
58 [IPCChannelTest.SendMessageInChannelConnected, IPCSyncChannelTest.Simple,
59 IPCSyncChannelTest.DISABLED_SendWithTimeoutMixedOKAndTimeout]
60 """
61 ret = []
62 current = ''
63 for test in raw_list:
64 if not test:
65 continue
66 if test[0] != ' ':
67 test_case = test.split()[0]
68 if test_case.endswith('.'):
69 current = test_case
70 elif not 'YOU HAVE' in test:
71 test_name = test.split()[0]
72 ret += [current + test_name]
73 return ret
74
75
41 class GtestTestInstance(test_instance.TestInstance): 76 class GtestTestInstance(test_instance.TestInstance):
42 77
43 def __init__(self, options, isolate_delegate): 78 def __init__(self, args, isolate_delegate):
44 super(GtestTestInstance, self).__init__() 79 super(GtestTestInstance, self).__init__()
80 # TODO(jbudorick): accept theirs during merge conflicts
klundberg 2014/12/09 02:30:47 I'm assuming this is just a note for yourself unti
jbudorick 2014/12/09 15:46:51 Yes, it is. I will probably hold this CL until Ran
45 self._apk_path = os.path.join( 81 self._apk_path = os.path.join(
46 constants.GetOutDirectory(), '%s_apk' % options.suite_name, 82 constants.GetOutDirectory(), '%s_apk' % args.suite_name[0],
47 '%s-debug.apk' % options.suite_name) 83 '%s-debug.apk' % args.suite_name[0])
48 self._data_deps = [] 84 self._data_deps = []
49 self._gtest_filter = options.test_filter 85 self._gtest_filter = args.test_filter
50 if options.isolate_file_path: 86 if args.isolate_file_path:
51 self._isolate_abs_path = os.path.abspath(options.isolate_file_path) 87 self._isolate_abs_path = os.path.abspath(args.isolate_file_path)
52 self._isolate_delegate = isolate_delegate 88 self._isolate_delegate = isolate_delegate
53 self._isolated_abs_path = os.path.join( 89 self._isolated_abs_path = os.path.join(
54 constants.GetOutDirectory(), '%s.isolated' % options.suite_name) 90 constants.GetOutDirectory(), '%s.isolated' % args.suite_name)
55 else: 91 else:
56 logging.warning('No isolate file provided. No data deps will be pushed.'); 92 logging.warning('No isolate file provided. No data deps will be pushed.');
57 self._isolate_delegate = None 93 self._isolate_delegate = None
58 self._suite = options.suite_name 94 self._suite = args.suite_name
59 95
60 #override 96 #override
61 def TestType(self): 97 def TestType(self):
62 return 'gtest' 98 return 'gtest'
63 99
64 #override 100 #override
65 def SetUp(self): 101 def SetUp(self):
66 """Map data dependencies via isolate.""" 102 """Map data dependencies via isolate."""
67 if self._isolate_delegate: 103 if self._isolate_delegate:
68 self._isolate_delegate.Remap( 104 self._isolate_delegate.Remap(
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 self._isolate_delegate.Clear() 164 self._isolate_delegate.Clear()
129 165
130 @property 166 @property
131 def apk(self): 167 def apk(self):
132 return self._apk_path 168 return self._apk_path
133 169
134 @property 170 @property
135 def suite(self): 171 def suite(self):
136 return self._suite 172 return self._suite
137 173
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698