cmParseJacocoCoverage.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 cmParseJacocoCoverage_h
  11. #define cmParseJacocoCoverage_h
  12. #include "cmCTestCoverageHandler.h"
  13. /** \class cmParseJacocoCoverage
  14. * \brief Parse JaCoCO coverage information
  15. *
  16. * This class is used to parse coverage information for
  17. * java using the JaCoCo tool:
  18. *
  19. * http://www.eclemma.org/jacoco/trunk/index.html
  20. */
  21. class cmParseJacocoCoverage
  22. {
  23. public:
  24. cmParseJacocoCoverage(cmCTestCoverageHandlerContainer& cont, cmCTest* ctest);
  25. bool LoadCoverageData(std::vector<std::string> const& files);
  26. std::string PackageName;
  27. std::string FileName;
  28. std::string ModuleName;
  29. std::string CurFileName;
  30. private:
  31. // implement virtual from parent
  32. // remove files with no coverage
  33. void RemoveUnCoveredFiles();
  34. // Read a single mcov file
  35. bool ReadJacocoXML(const char* f);
  36. // split a string based on ,
  37. bool SplitString(std::vector<std::string>& args, std::string const& line);
  38. bool FindJavaFile(std::string const& routine, std::string& filepath);
  39. void InitializeJavaFile(std::string& file);
  40. bool LoadSource(std::string d);
  41. class XMLParser;
  42. std::map<std::string, std::string> RoutineToDirectory;
  43. cmCTestCoverageHandlerContainer& Coverage;
  44. cmCTest* CTest;
  45. };
  46. #endif