2014-08-23 06:56:03 +08:00
|
|
|
//===- CoverageReport.h - Code coverage report ---------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This class implements rendering of a code coverage report.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_COV_COVERAGEREPORT_H
|
|
|
|
#define LLVM_COV_COVERAGEREPORT_H
|
|
|
|
|
2015-02-14 10:01:24 +08:00
|
|
|
#include "CoverageSummaryInfo.h"
|
2015-01-14 19:23:27 +08:00
|
|
|
#include "CoverageViewOptions.h"
|
2014-08-23 06:56:03 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
/// \brief Displays the code coverage report.
|
|
|
|
class CoverageReport {
|
|
|
|
const CoverageViewOptions &Options;
|
2016-09-07 06:45:57 +08:00
|
|
|
const coverage::CoverageMapping &Coverage;
|
2014-08-23 06:56:03 +08:00
|
|
|
|
2016-09-09 09:32:49 +08:00
|
|
|
void render(const FileCoverageSummary &File, raw_ostream &OS) const;
|
2017-02-06 04:11:03 +08:00
|
|
|
void render(const FunctionCoverageSummary &Function, const DemangleCache &DC,
|
|
|
|
raw_ostream &OS) const;
|
2014-08-23 06:56:03 +08:00
|
|
|
|
|
|
|
public:
|
2015-02-14 10:01:24 +08:00
|
|
|
CoverageReport(const CoverageViewOptions &Options,
|
2016-09-07 06:45:57 +08:00
|
|
|
const coverage::CoverageMapping &Coverage)
|
|
|
|
: Options(Options), Coverage(Coverage) {}
|
2014-08-23 06:56:03 +08:00
|
|
|
|
2017-02-06 04:11:03 +08:00
|
|
|
void renderFunctionReports(ArrayRef<std::string> Files,
|
|
|
|
const DemangleCache &DC, raw_ostream &OS);
|
2014-08-23 06:56:03 +08:00
|
|
|
|
2016-09-09 09:32:49 +08:00
|
|
|
/// Prepare file reports for the files specified in \p Files.
|
2016-09-19 08:38:25 +08:00
|
|
|
static std::vector<FileCoverageSummary>
|
|
|
|
prepareFileReports(const coverage::CoverageMapping &Coverage,
|
2017-09-09 02:44:49 +08:00
|
|
|
FileCoverageSummary &Totals, ArrayRef<std::string> Files,
|
2017-09-28 00:20:07 +08:00
|
|
|
const CoverageViewOptions &Options);
|
2016-09-09 09:32:49 +08:00
|
|
|
|
|
|
|
/// Render file reports for every unique file in the coverage mapping.
|
|
|
|
void renderFileReports(raw_ostream &OS) const;
|
|
|
|
|
2017-09-28 00:20:07 +08:00
|
|
|
/// Render file reports for the files specified in \p Files.
|
|
|
|
void renderFileReports(raw_ostream &OS, ArrayRef<std::string> Files) const;
|
2014-08-23 06:56:03 +08:00
|
|
|
};
|
2016-09-07 06:45:57 +08:00
|
|
|
|
|
|
|
} // end namespace llvm
|
2014-08-23 06:56:03 +08:00
|
|
|
|
|
|
|
#endif // LLVM_COV_COVERAGEREPORT_H
|