Imported Upstream version 2.8.10.2
[platform/upstream/cmake.git] / Source / CTest / cmCTestBuildAndTestHandler.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc.
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
8   This software is distributed WITHOUT ANY WARRANTY; without even the
9   implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10   See the License for more information.
11 ============================================================================*/
12
13 #ifndef cmCTestBuildAndTestHandler_h
14 #define cmCTestBuildAndTestHandler_h
15
16
17 #include "cmCTestGenericHandler.h"
18 #include "cmListFileCache.h"
19
20 class cmake;
21
22 /** \class cmCTestBuildAndTestHandler
23  * \brief A class that handles ctest -S invocations
24  *
25  */
26 class cmCTestBuildAndTestHandler : public cmCTestGenericHandler
27 {
28 public:
29   cmTypeMacro(cmCTestBuildAndTestHandler, cmCTestGenericHandler);
30
31   /*
32    * The main entry point for this class
33    */
34   int ProcessHandler();
35
36   //! Set all the build and test arguments
37   virtual int ProcessCommandLineArguments(
38     const std::string& currentArg, size_t& idx,
39     const std::vector<std::string>& allArgs);
40
41   /*
42    * Get the output variable
43    */
44   const char* GetOutput();
45
46   cmCTestBuildAndTestHandler();
47
48   virtual void Initialize();
49
50 protected:
51   ///! Run CMake and build a test and then run it as a single test.
52   int RunCMakeAndTest(std::string* output);
53   int RunCMake(std::string* outstring, cmOStringStream &out,
54                std::string &cmakeOutString,
55                std::string &cwd, cmake *cm);
56
57   cmStdString  Output;
58
59   std::string              BuildGenerator;
60   std::vector<std::string> BuildOptions;
61   bool                     BuildTwoConfig;
62   std::string              BuildMakeProgram;
63   std::string              ConfigSample;
64   std::string              SourceDir;
65   std::string              BinaryDir;
66   std::string              BuildProject;
67   std::string              TestCommand;
68   bool                     BuildNoClean;
69   std::string              BuildRunDir;
70   std::string              ExecutableDirectory;
71   std::vector<std::string> TestCommandArgs;
72   std::vector<std::string> BuildTargets;
73   bool                     BuildNoCMake;
74   double                   Timeout;
75 };
76
77 #endif
78