cmParsePHPCoverage.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 cmParsePHPCoverage_h
  11. #define cmParsePHPCoverage_h
  12. #include <cmConfigure.h> // IWYU pragma: keep
  13. #include <iosfwd>
  14. #include <string>
  15. class cmCTest;
  16. class cmCTestCoverageHandlerContainer;
  17. /** \class cmParsePHPCoverage
  18. * \brief Parse xdebug PHP coverage information
  19. *
  20. * This class is used to parse php coverage information produced
  21. * by xdebug. The data is stored as a php dump of the array
  22. * return by xdebug coverage. It is an array of arrays.
  23. */
  24. class cmParsePHPCoverage
  25. {
  26. public:
  27. cmParsePHPCoverage(cmCTestCoverageHandlerContainer& cont, cmCTest* ctest);
  28. bool ReadPHPCoverageDirectory(const char* dir);
  29. void PrintCoverage();
  30. private:
  31. bool ReadPHPData(const char* file);
  32. bool ReadArraySize(std::istream& in, int& size);
  33. bool ReadFileInformation(std::istream& in);
  34. bool ReadInt(std::istream& in, int& v);
  35. bool ReadCoverageArray(std::istream& in, std::string const&);
  36. bool ReadUntil(std::istream& in, char until);
  37. cmCTestCoverageHandlerContainer& Coverage;
  38. cmCTest* CTest;
  39. };
  40. #endif