Initial commit.
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / CTest / cmCTestGenericHandler.h
blob298d4b12df7219c2bb0666e40943718cc4cb2734
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCTestGenericHandler.h,v $
5 Language: C++
6 Date: $Date: 2006/04/28 15:59:31 $
7 Version: $Revision: 1.11 $
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
22 #include "cmObject.h"
24 class cmCTest;
25 class cmMakefile;
26 class cmCTestCommand;
27 class cmGeneratedFileStream;
29 /** \class cmCTestGenericHandler
30 * \brief A superclass of all CTest Handlers
33 class cmCTestGenericHandler : public cmObject
35 public:
36 /**
37 * If verbose then more informaiton is printed out
39 void SetVerbose(bool val) { this->HandlerVerbose = val; }
41 /**
42 * Populate internals from CTest custom scripts
44 virtual void PopulateCustomVectors(cmMakefile *) {}
46 /**
47 * Do the actual processing. Subclass has to override it.
48 * Return < 0 if error.
50 virtual int ProcessHandler() = 0;
52 /**
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; }
59 /**
60 * Initialize handler
62 virtual void Initialize();
64 /**
65 * Set the CTest instance
67 void SetCTestInstance(cmCTest* ctest) { this->CTest = ctest; }
68 cmCTest* GetCTestInstance() { return this->CTest; }
70 /**
71 * Construct handler
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 protected:
92 bool StartResultingXML(const char* name, cmGeneratedFileStream& xofs);
93 bool StartLogFile(const char* name, cmGeneratedFileStream& xofs);
95 bool HandlerVerbose;
96 cmCTest *CTest;
97 t_StringToString Options;
98 t_StringToString PersistentOptions;
100 cmCTestCommand* Command;
101 int SubmitIndex;
104 #endif