Lines Matching refs:self
59 def __init__(self, adb_interface): argument
60 self._root_path = android_build.GetTop()
61 self._out_path = android_build.GetOut()
62 self._output_root_path = os.path.join(self._out_path,
63 self._COVERAGE_REPORT_PATH)
64 self._emma_jar_path = os.path.join(self._root_path, self._EMMA_JAR)
65 self._adb = adb_interface
66 self._targets_manifest = self._ReadTargets()
68 def ExtractReport(self, argument
93 output_path = os.path.join(self._out_path,
94 self._COVERAGE_REPORT_PATH,
99 self._TEST_COVERAGE_EXT)
102 if self._adb.Pull(device_coverage_path, coverage_local_path):
106 return self._GenerateReport(report_path, coverage_local_path, [target],
110 def _GenerateReport(self, report_path, coverage_file_path, targets, argument
125 input_metadatas = self._GatherMetadatas(targets)
128 src_arg = self._GatherSrcs(targets)
134 (self._emma_jar_path, coverage_file_path, input_metadatas, src_arg))
136 self._RunCmd(cmd1 + cmd2)
139 def _GatherMetadatas(self, targets): argument
150 input_metadata = os.path.join(self._GetBuildIntermediatePath(target),
155 def _GetBuildIntermediatePath(self, target): argument
157 self._out_path, self._TARGET_INTERMEDIATES_BASE_PATH, target.GetType(),
160 def _GatherSrcs(self, targets): argument
172 src_list.append("-sp %s" % os.path.join(self._root_path, path))
175 def _MergeFiles(self, input_paths, dest_path): argument
186 self._RunCmd("java -cp %s emma merge %s -out %s" % (self._emma_jar_path,
189 def _RunCmd(self, cmd): argument
193 def _CombineTargetCoverage(self): argument
200 coverage_files = self._FindCoverageFiles(self._output_root_path)
201 combined_coverage = os.path.join(self._output_root_path,
202 "android.%s" % self._TEST_COVERAGE_EXT)
203 self._MergeFiles(coverage_files, combined_coverage)
204 report_path = os.path.join(self._output_root_path, "android")
206 self._GenerateReport(report_path, combined_coverage,
207 self._targets_manifest.GetTargets(), do_src=False)
209 def _CombineTestCoverage(self): argument
211 target_dirs = os.listdir(self._output_root_path)
213 output_path = os.path.join(self._output_root_path, target_name)
214 target = self._targets_manifest.GetTarget(target_name)
216 coverage_files = self._FindCoverageFiles(output_path)
218 (target_name, self._TEST_COVERAGE_EXT))
219 self._MergeFiles(coverage_files, combined_coverage)
221 self._GenerateReport(report_path, combined_coverage, [target])
225 def _FindCoverageFiles(self, root_path): argument
234 self._TEST_COVERAGE_EXT)
238 def _ReadTargets(self): argument
246 core_target_path = os.path.join(self._root_path, self._CORE_TARGET_PATH)
250 vendor_targets_pattern = os.path.join(self._root_path,
251 self._VENDOR_TARGET_PATH)
259 def TidyOutput(self): argument
266 self._TidyDir(self._output_root_path)
268 def _TidyDir(self, dir_path): argument
278 self._TidyDir(sub_dir_path)
280 def CombineCoverage(self): argument
282 self._CombineTestCoverage()
283 self._CombineTargetCoverage()
285 def GetCoverageTarget(self, name): argument
287 target = self._targets_manifest.GetTarget(name)
290 msg.append(" Ensure target is defined in %s" % self._TARGET_DEF_FILE)
294 def GetCoverageTargetForPath(self, path): argument