cmParsePHPCoverage.h 1.4 KB

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