cmParseCoberturaCoverage.h 1.6 KB

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