cmParseCoberturaCoverage.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 "cmStandardIncludes.h"
  13. #include "cmCTestCoverageHandler.h"
  14. /** \class cmParsePythonCoverage
  15. * \brief Parse coverage.py Python coverage information
  16. *
  17. * This class is used to parse the output of the coverage.py tool that
  18. * is currently maintained by Ned Batchelder. That tool has a command
  19. * that produces xml output in the format typically output by the common
  20. * Java-based Cobertura coverage application. This helper class parses
  21. * that XML file to fill the coverage-handler container.
  22. */
  23. class cmParseCoberturaCoverage
  24. {
  25. public:
  26. //! Create the coverage parser by passing in the coverage handler
  27. //! container and the cmCTest object
  28. cmParseCoberturaCoverage(cmCTestCoverageHandlerContainer& cont,
  29. cmCTest* ctest);
  30. bool inSources;
  31. bool inSource;
  32. std::vector<std::string> filepaths;
  33. //! Read the XML produced by running `coverage xml`
  34. bool ReadCoverageXML(const char* xmlFile);
  35. private:
  36. class XMLParser;
  37. cmCTestCoverageHandlerContainer& Coverage;
  38. cmCTest* CTest;
  39. std::string CurFileName;
  40. };
  41. #endif