TZIVI-254: IVI needs a newer version of cmake
[profile/ivi/cmake.git] / Source / CTest / cmCTestSubmitCommand.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
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 #ifndef cmCTestSubmitCommand_h
13 #define cmCTestSubmitCommand_h
14
15 #include "cmCTestHandlerCommand.h"
16 #include "cmCTest.h"
17
18 /** \class cmCTestSubmit
19  * \brief Run a ctest script
20  *
21  * cmCTestSubmitCommand defineds the command to submit the test results for
22  * the project.
23  */
24 class cmCTestSubmitCommand : public cmCTestHandlerCommand
25 {
26 public:
27
28   cmCTestSubmitCommand()
29     {
30     this->PartsMentioned = false;
31     this->FilesMentioned = false;
32     this->InternalTest = false;
33     this->RetryCount = "";
34     this->RetryDelay = "";
35     }
36
37   /**
38    * This is a virtual constructor for the command.
39    */
40   virtual cmCommand* Clone()
41     {
42     cmCTestSubmitCommand* ni = new cmCTestSubmitCommand;
43     ni->CTest = this->CTest;
44     ni->CTestScriptHandler = this->CTestScriptHandler;
45     return ni;
46     }
47
48   /**
49    * The name of the command as specified in CMakeList.txt.
50    */
51   virtual const char* GetName() const { return "ctest_submit";}
52
53   /**
54    * Succinct documentation.
55    */
56   virtual const char* GetTerseDocumentation() const
57     {
58     return "Submit results to a dashboard server.";
59     }
60
61   /**
62    * More documentation.
63    */
64   virtual const char* GetFullDocumentation() const
65     {
66     return
67       "  ctest_submit([PARTS ...] [FILES ...] [RETRY_COUNT count] "
68       "               [RETRY_DELAY delay][RETURN_VALUE res])\n"
69       "By default all available parts are submitted if no PARTS or FILES "
70       "are specified.  "
71       "The PARTS option lists a subset of parts to be submitted.  "
72       "Valid part names are:\n"
73       "  Start      = nothing\n"
74       "  Update     = ctest_update results, in Update.xml\n"
75       "  Configure  = ctest_configure results, in Configure.xml\n"
76       "  Build      = ctest_build results, in Build.xml\n"
77       "  Test       = ctest_test results, in Test.xml\n"
78       "  Coverage   = ctest_coverage results, in Coverage.xml\n"
79       "  MemCheck   = ctest_memcheck results, in DynamicAnalysis.xml\n"
80       "  Notes      = Files listed by CTEST_NOTES_FILES, in Notes.xml\n"
81       "  ExtraFiles = Files listed by CTEST_EXTRA_SUBMIT_FILES\n"
82       "  Submit     = nothing\n"
83       "The FILES option explicitly lists specific files to be submitted.  "
84       "Each individual file must exist at the time of the call.\n"
85       "The RETRY_DELAY option specifies how long in seconds to wait after "
86       "a timed-out submission before attempting to re-submit.\n"
87       "The RETRY_COUNT option specifies how many times to retry a timed-out "
88       "submission.\n";
89     }
90
91   cmTypeMacro(cmCTestSubmitCommand, cmCTestHandlerCommand);
92
93 protected:
94   cmCTestGenericHandler* InitializeHandler();
95
96   virtual bool CheckArgumentKeyword(std::string const& arg);
97   virtual bool CheckArgumentValue(std::string const& arg);
98
99   enum
100   {
101     ArgumentDoingParts = Superclass::ArgumentDoingLast1,
102     ArgumentDoingFiles,
103     ArgumentDoingRetryDelay,
104     ArgumentDoingRetryCount,
105     ArgumentDoingLast2
106   };
107
108   bool PartsMentioned;
109   std::set<cmCTest::Part> Parts;
110   bool FilesMentioned;
111   bool InternalTest;
112   cmCTest::SetOfStrings Files;
113   std::string RetryCount;
114   std::string RetryDelay;
115 };
116
117
118 #endif