cmParseCoberturaCoverage.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #pragma once
  4. #include "cmConfigure.h" // IWYU pragma: keep
  5. #include <string>
  6. #include <vector>
  7. class cmCTest;
  8. class cmCTestCoverageHandlerContainer;
  9. /** \class cmParsePythonCoverage
  10. * \brief Parse coverage.py Python coverage information
  11. *
  12. * This class is used to parse the output of the coverage.py tool that
  13. * is currently maintained by Ned Batchelder. That tool has a command
  14. * that produces xml output in the format typically output by the common
  15. * Java-based Cobertura coverage application. This helper class parses
  16. * that XML file to fill the coverage-handler container.
  17. */
  18. class cmParseCoberturaCoverage
  19. {
  20. public:
  21. //! Create the coverage parser by passing in the coverage handler
  22. //! container and the cmCTest object
  23. cmParseCoberturaCoverage(cmCTestCoverageHandlerContainer& cont,
  24. cmCTest* ctest);
  25. bool inSources;
  26. bool inSource;
  27. std::vector<std::string> filepaths;
  28. //! Read the XML produced by running `coverage xml`
  29. bool ReadCoverageXML(const char* xmlFile);
  30. private:
  31. class XMLParser;
  32. cmCTestCoverageHandlerContainer& Coverage;
  33. cmCTest* CTest;
  34. std::string CurFileName;
  35. };