cmCTestBuildHandler.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmCTestBuildHandler_h
  14. #define cmCTestBuildHandler_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmListFileCache.h"
  17. #include <cmsys/RegularExpression.hxx>
  18. class cmCTest;
  19. class cmMakefile;
  20. /** \class cmCTestBuildHandler
  21. * \brief A class that handles ctest -S invocations
  22. *
  23. */
  24. class cmCTestBuildHandler
  25. {
  26. public:
  27. /*
  28. * The main entry point for this class
  29. */
  30. int BuildDirectory(cmCTest *);
  31. /*
  32. * If verbose then more informaiton is printed out
  33. */
  34. void SetVerbose(bool val) { m_Verbose = val; }
  35. cmCTestBuildHandler();
  36. void PopulateCustomVectors(cmMakefile *mf);
  37. private:
  38. class cmCTestCompileErrorWarningRex
  39. {
  40. public:
  41. cmCTestCompileErrorWarningRex() {}
  42. int m_FileIndex;
  43. int m_LineIndex;
  44. cmsys::RegularExpression m_RegularExpression;
  45. };
  46. struct cmCTestBuildErrorWarning
  47. {
  48. bool m_Error;
  49. int m_LogLine;
  50. std::string m_Text;
  51. std::string m_SourceFile;
  52. std::string m_SourceFileTail;
  53. int m_LineNumber;
  54. std::string m_PreContext;
  55. std::string m_PostContext;
  56. };
  57. // generate the XML output
  58. void GenerateDartBuildOutput(std::ostream& os,
  59. std::vector<cmCTestBuildErrorWarning>,
  60. double elapsed_time);
  61. bool m_Verbose;
  62. cmCTest *m_CTest;
  63. std::string m_StartBuild;
  64. std::string m_EndBuild;
  65. std::vector<cmStdString> m_CustomErrorMatches;
  66. std::vector<cmStdString> m_CustomErrorExceptions;
  67. std::vector<cmStdString> m_CustomWarningMatches;
  68. std::vector<cmStdString> m_CustomWarningExceptions;
  69. std::vector<cmCTestCompileErrorWarningRex> m_ErrorWarningFileLineRegex;
  70. };
  71. #endif