cmParseJacocoCoverage.h 1.7 KB

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