cmParseCoberturaCoverage.h 1.3 KB

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