cmParsePHPCoverage.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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,
  24. cmCTest* ctest);
  25. bool ReadPHPCoverageDirectory(const char* dir);
  26. void PrintCoverage();
  27. private:
  28. bool ReadPHPData(const char* file);
  29. bool ReadArraySize(std::istream& in, int& size);
  30. bool ReadFileInformation(std::istream& in);
  31. bool ReadInt(std::istream& in, int& v);
  32. bool ReadCoverageArray(std::istream& in, std::string const&);
  33. bool ReadUntil(std::istream& in, char until);
  34. cmCTestCoverageHandlerContainer& Coverage;
  35. cmCTest* CTest;
  36. };
  37. #endif