cmParseCoberturaCoverage.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc.
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmParseCoberturaCoverage_h
  11. #define cmParseCoberturaCoverage_h
  12. #include <cmConfigure.h> // IWYU pragma: keep
  13. #include <string>
  14. #include <vector>
  15. class cmCTest;
  16. class cmCTestCoverageHandlerContainer;
  17. /** \class cmParsePythonCoverage
  18. * \brief Parse coverage.py Python coverage information
  19. *
  20. * This class is used to parse the output of the coverage.py tool that
  21. * is currently maintained by Ned Batchelder. That tool has a command
  22. * that produces xml output in the format typically output by the common
  23. * Java-based Cobertura coverage application. This helper class parses
  24. * that XML file to fill the coverage-handler container.
  25. */
  26. class cmParseCoberturaCoverage
  27. {
  28. public:
  29. //! Create the coverage parser by passing in the coverage handler
  30. //! container and the cmCTest object
  31. cmParseCoberturaCoverage(cmCTestCoverageHandlerContainer& cont,
  32. cmCTest* ctest);
  33. bool inSources;
  34. bool inSource;
  35. std::vector<std::string> filepaths;
  36. //! Read the XML produced by running `coverage xml`
  37. bool ReadCoverageXML(const char* xmlFile);
  38. private:
  39. class XMLParser;
  40. cmCTestCoverageHandlerContainer& Coverage;
  41. cmCTest* CTest;
  42. std::string CurFileName;
  43. };
  44. #endif