1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCTestBuildHandler.h,v $
6 Date: $Date: 2006-03-10 20:03:08 $
7 Version: $Revision: 1.12 $
9 Copyright (c) 2002 Kitware, Inc. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
18 #ifndef cmCTestBuildHandler_h
19 #define cmCTestBuildHandler_h
22 #include "cmCTestGenericHandler.h"
23 #include "cmListFileCache.h"
25 #include <cmsys/RegularExpression.hxx>
29 /** \class cmCTestBuildHandler
30 * \brief A class that handles ctest -S invocations
33 class cmCTestBuildHandler
: public cmCTestGenericHandler
36 cmTypeMacro(cmCTestBuildHandler
, cmCTestGenericHandler
);
39 * The main entry point for this class
43 cmCTestBuildHandler();
45 void PopulateCustomVectors(cmMakefile
*mf
);
50 virtual void Initialize();
53 //! Run command specialized for make and configure. Returns process status
54 // and retVal is return value or exception.
55 int RunMakeCommand(const char* command
,
56 int* retVal
, const char* dir
, int timeout
,
65 class cmCTestCompileErrorWarningRex
68 cmCTestCompileErrorWarningRex() {}
71 cmsys::RegularExpression RegularExpression
;
74 struct cmCTestBuildErrorWarning
79 std::string SourceFile
;
80 std::string SourceFileTail
;
82 std::string PreContext
;
83 std::string PostContext
;
86 // generate the XML output
87 void GenerateDartBuildOutput(std::ostream
& os
,
88 std::vector
<cmCTestBuildErrorWarning
>,
92 std::string StartBuild
;
95 std::vector
<cmStdString
> CustomErrorMatches
;
96 std::vector
<cmStdString
> CustomErrorExceptions
;
97 std::vector
<cmStdString
> CustomWarningMatches
;
98 std::vector
<cmStdString
> CustomWarningExceptions
;
99 std::vector
<cmCTestCompileErrorWarningRex
> ErrorWarningFileLineRegex
;
101 std::vector
<cmsys::RegularExpression
> ErrorMatchRegex
;
102 std::vector
<cmsys::RegularExpression
> ErrorExceptionRegex
;
103 std::vector
<cmsys::RegularExpression
> WarningMatchRegex
;
104 std::vector
<cmsys::RegularExpression
> WarningExceptionRegex
;
106 typedef std::deque
<char> t_BuildProcessingQueueType
;
108 void ProcessBuffer(const char* data
, int length
, size_t& tick
,
109 size_t tick_len
, std::ofstream
& ofs
, t_BuildProcessingQueueType
* queue
);
110 int ProcessSingleLine(const char* data
);
112 t_BuildProcessingQueueType BuildProcessingQueue
;
113 t_BuildProcessingQueueType BuildProcessingErrorQueue
;
114 size_t BuildOutputLogSize
;
115 std::vector
<char> CurrentProcessingLine
;
117 cmStdString SimplifySourceDir
;
118 cmStdString SimplifyBuildDir
;
119 size_t OutputLineCounter
;
120 typedef std::vector
<cmCTestBuildErrorWarning
> t_ErrorsAndWarningsVector
;
121 t_ErrorsAndWarningsVector ErrorsAndWarnings
;
122 t_ErrorsAndWarningsVector::iterator LastErrorOrWarning
;
123 size_t PostContextCount
;
124 size_t MaxPreContext
;
125 size_t MaxPostContext
;
126 std::deque
<cmStdString
> PreContext
;
132 bool ErrorQuotaReached
;
133 bool WarningQuotaReached
;