ENH: check in almost building VMS stuff with VMSBuild directory since the bootstrap...
[cmake.git] / Source / CTest / cmCTestGenericHandler.h
blob7628a1f5b057f238243a4cba25f9d77a54418b12
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmCTestGenericHandler.h,v $
5 Language: C++
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
22 #include "cmObject.h"
23 #include "cmCTest.h"
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 void SetAppendXML(bool b) { this->AppendXML = b; }
93 protected:
94 bool StartResultingXML(cmCTest::Part part,
95 const char* name, cmGeneratedFileStream& xofs);
96 bool StartLogFile(const char* name, cmGeneratedFileStream& xofs);
98 bool AppendXML;
99 bool HandlerVerbose;
100 cmCTest *CTest;
101 t_StringToString Options;
102 t_StringToString PersistentOptions;
104 cmCTestCommand* Command;
105 int SubmitIndex;
108 #endif