1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCTestGenericHandler.h,v $
6 Date: $Date: 2009-01-12 15:37:55 $
7 Version: $Revision: 1.13 $
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 cmCTestGenericHandler_h
19 #define cmCTestGenericHandler_h
27 class cmGeneratedFileStream
;
29 /** \class cmCTestGenericHandler
30 * \brief A superclass of all CTest Handlers
33 class cmCTestGenericHandler
: public cmObject
37 * If verbose then more informaiton is printed out
39 void SetVerbose(bool val
) { this->HandlerVerbose
= val
; }
42 * Populate internals from CTest custom scripts
44 virtual void PopulateCustomVectors(cmMakefile
*) {}
47 * Do the actual processing. Subclass has to override it.
48 * Return < 0 if error.
50 virtual int ProcessHandler() = 0;
53 * Process command line arguments that are applicable for the handler
55 virtual int ProcessCommandLineArguments(
56 const std::string
& /*currentArg*/, size_t& /*idx*/,
57 const std::vector
<std::string
>& /*allArgs*/) { return 1; }
62 virtual void Initialize();
65 * Set the CTest instance
67 void SetCTestInstance(cmCTest
* ctest
) { this->CTest
= ctest
; }
68 cmCTest
* GetCTestInstance() { return this->CTest
; }
73 cmCTestGenericHandler();
74 virtual ~cmCTestGenericHandler();
76 typedef std::map
<cmStdString
,cmStdString
> t_StringToString
;
79 void SetPersistentOption(const char* op
, const char* value
);
80 void SetOption(const char* op
, const char* value
);
81 const char* GetOption(const char* op
);
83 void SetCommand(cmCTestCommand
* command
)
85 this->Command
= command
;
88 void SetSubmitIndex(int idx
) { this->SubmitIndex
= idx
; }
89 int GetSubmitIndex() { return this->SubmitIndex
; }
91 void SetAppendXML(bool b
) { this->AppendXML
= b
; }
94 bool StartResultingXML(cmCTest::Part part
,
95 const char* name
, cmGeneratedFileStream
& xofs
);
96 bool StartLogFile(const char* name
, cmGeneratedFileStream
& xofs
);
101 t_StringToString Options
;
102 t_StringToString PersistentOptions
;
104 cmCTestCommand
* Command
;