cmParsePHPCoverage.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #pragma once
  4. #include "cmConfigure.h" // IWYU pragma: keep
  5. #include <iosfwd>
  6. #include <string>
  7. class cmCTest;
  8. class cmCTestCoverageHandlerContainer;
  9. /** \class cmParsePHPCoverage
  10. * \brief Parse xdebug PHP coverage information
  11. *
  12. * This class is used to parse php coverage information produced
  13. * by xdebug. The data is stored as a php dump of the array
  14. * return by xdebug coverage. It is an array of arrays.
  15. */
  16. class cmParsePHPCoverage
  17. {
  18. public:
  19. cmParsePHPCoverage(cmCTestCoverageHandlerContainer& cont, cmCTest* ctest);
  20. bool ReadPHPCoverageDirectory(const char* dir);
  21. void PrintCoverage();
  22. private:
  23. bool ReadPHPData(const char* file);
  24. bool ReadArraySize(std::istream& in, int& size);
  25. bool ReadFileInformation(std::istream& in);
  26. bool ReadInt(std::istream& in, int& v);
  27. bool ReadCoverageArray(std::istream& in, std::string const&);
  28. bool ReadUntil(std::istream& in, char until);
  29. cmCTestCoverageHandlerContainer& Coverage;
  30. cmCTest* CTest;
  31. };