cmParseJacocoCoverage.h 1.4 KB

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