Ejemplo n.º 1
0
void
SourceCoverageView::renderLineCoverageColumn(raw_ostream &OS,
                                             const LineCoverageInfo &Line) {
  if (!Line.isMapped()) {
    OS.indent(LineCoverageColumnWidth) << '|';
    return;
  }
  std::string C = formatCount(Line.ExecutionCount);
  OS.indent(LineCoverageColumnWidth - C.size());
  colored_ostream(OS, raw_ostream::MAGENTA,
                  Line.hasMultipleRegions() && Options.Colors)
      << C;
  OS << '|';
}
Ejemplo n.º 2
0
void
SourceCoverageView::renderLineCoverageColumn(raw_ostream &OS,
                                             const LineCoverageInfo &Line) {
  if (!Line.isMapped()) {
    OS.indent(LineCoverageColumnWidth) << '|';
    return;
  }
  SmallString<32> Buffer;
  raw_svector_ostream BufferOS(Buffer);
  BufferOS << Line.ExecutionCount;
  auto Str = BufferOS.str();
  // Trim
  Str = Str.substr(0, std::min(Str.size(), (size_t)LineCoverageColumnWidth));
  // Align to the right
  OS.indent(LineCoverageColumnWidth - Str.size());
  colored_ostream(OS, raw_ostream::MAGENTA,
                  Line.hasMultipleRegions() && Options.Colors)
      << Str;
  OS << '|';
}