}
if ($coverage) {
- $file_coverage = array();
+ $file_coverage = array_fill_keys(
+ $paths,
+ 0);
$file_reports = array();
foreach ($coverage as $file => $reports) {
$report = ArcanistUnitTestResult::mergeCoverage($reports);
sprintf('% 3d', (int)(100 * $coverage)),
$file);
- if ($this->getArgument('detailed-coverage')) {
+ $full_path = $working_copy->getProjectRoot().'/'.$file;
+ if ($this->getArgument('detailed-coverage') &&
+ Filesystem::pathExists($full_path) &&
+ is_file($full_path)) {
echo $this->renderDetailedCoverageReport(
- $file,
+ Filesystem::readFile($full_path),
$file_reports[$file]);
}
}
return ' <1ms';
}
- private function renderDetailedCoverageReport($file, $report) {
- $data = $this->getRepositoryAPI()->getCurrentFileData($file);
+ private function renderDetailedCoverageReport($data, $report) {
$data = explode("\n", $data);
$out = '';
phutil_require_module('arcanist', 'workflow/base');
phutil_require_module('phutil', 'console');
+phutil_require_module('phutil', 'filesystem');
phutil_require_module('phutil', 'symbols');
phutil_require_module('phutil', 'utils');