Lines Matching full:self
73 def __init__(self):
75 self._root_path = android_build.GetTop()
77 self._adb = None
78 self._known_tests = None
79 self._options = None
80 self._test_args = None
81 self._tests_to_run = None
83 def _ProcessOptions(self):
87 self._TEST_FILE_NAME)
89 parser = optparse.OptionParser(usage=self._RUNTEST_USAGE)
97 metavar="X", default=self._DEFAULT_JOBS,
161 self._options, self._test_args = parser.parse_args()
163 if (not self._options.only_list_tests
164 and not self._options.all_tests
165 and not self._options.continuous_tests
166 and not self._options.suite
167 and not self._options.test_path
168 and len(self._test_args) < 1):
173 self._adb = adb_interface.AdbInterface()
174 if self._options.emulator:
175 self._adb.SetEmulatorTarget()
176 elif self._options.device:
177 self._adb.SetDeviceTarget()
178 elif self._options.serial is not None:
179 self._adb.SetTargetSerial(self._options.serial)
181 if self._options.verbose:
184 self._known_tests = self._ReadTests()
186 self._options.host_lib_path = android_build.GetHostLibraryPath()
187 self._options.test_data_path = android_build.GetTestAppPath()
189 def _ReadTests(self):
197 core_test_path = os.path.join(self._root_path, self._CORE_TEST_PATH)
202 vendor_tests_pattern = os.path.join(self._root_path,
203 self._VENDOR_TEST_PATH)
207 if os.path.isfile(self._options.user_tests_file):
208 known_tests.Parse(self._options.user_tests_file)
213 def _DumpTests(self):
218 for test in self._known_tests:
221 print "\nSee %s for more information" % self._TEST_FILE_NAME
223 def _DoBuild(self):
227 tests = self._GetTestsToRun()
229 self._AddBuildTarget(test_suite, target_set, extra_args_set)
232 if self._options.coverage:
238 if self._IsCtsTests(tests):
241 self._options.make_jobs)
243 if not self._options.preview:
245 os.chdir(self._root_path)
253 target_build_string, self._options.make_jobs, self._root_path,
257 if self._options.preview:
264 self._adb.Sync()
266 def _AddBuildTarget(self, test_suite, target_set, extra_args_set):
268 if self._AddBuildTargetPath(build_dir, target_set):
270 for path in test_suite.GetBuildDependencies(self._options):
271 self._AddBuildTargetPath(path, target_set)
273 def _AddBuildTargetPath(self, build_dir, target_set):
276 if os.path.isfile(os.path.join(self._root_path, build_file_path)):
283 def _GetTestsToRun(self):
285 if self._tests_to_run:
286 return self._tests_to_run
288 self._tests_to_run = []
289 if self._options.all_tests:
290 self._tests_to_run = self._known_tests.GetTests()
291 elif self._options.continuous_tests:
292 self._tests_to_run = self._known_tests.GetContinuousTests()
293 elif self._options.suite:
294 self._tests_to_run = \
295 self._known_tests.GetTestsInSuite(self._options.suite)
296 elif self._options.test_path:
298 self._tests_to_run = walker.FindTests(self._options.test_path)
300 for name in self._test_args:
301 test = self._known_tests.GetTest(name)
304 self._DumpTests()
306 self._tests_to_run.append(test)
307 return self._tests_to_run
309 def _IsCtsTests(self, test_list):
316 def RunTests(self):
320 self._ProcessOptions()
321 if self._options.only_list_tests:
322 self._DumpTests()
325 if not self._options.skip_build:
326 self._DoBuild()
328 for test_suite in self._GetTestsToRun():
330 test_suite.Run(self._options, self._adb)