Imported Upstream version 2.8.12.2
[platform/upstream/cmake.git] / Source / cmSetTestsPropertiesCommand.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 cmSetTestsPropertiesCommand_h
13 #define cmSetTestsPropertiesCommand_h
14
15 #include "cmCommand.h"
16
17 class cmSetTestsPropertiesCommand : public cmCommand
18 {
19 public:
20   virtual cmCommand* Clone()
21     {
22     return new cmSetTestsPropertiesCommand;
23     }
24
25   /**
26    * This is called when the command is first encountered in
27    * the input file.
28    */
29   virtual bool InitialPass(std::vector<std::string> const& args,
30                            cmExecutionStatus &status);
31
32   /**
33    * The name of the command as specified in CMakeList.txt.
34    */
35   virtual const char* GetName() const { return "set_tests_properties";}
36
37   /**
38    * Succinct documentation.
39    */
40   virtual const char* GetTerseDocumentation() const
41     {
42     return "Set a property of the tests.";
43     }
44
45   /**
46    * Longer documentation.
47    */
48   virtual const char* GetFullDocumentation() const
49     {
50     return
51       "  set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2"
52       " value2)\n"
53       "Set a property for the tests. If the property is not found, CMake "
54       "will report an error. The properties include:\n"
55       "WILL_FAIL: If set to true, this will invert the pass/fail flag of the"
56       " test.\n"
57       "PASS_REGULAR_EXPRESSION: If set, the test output will be checked "
58       "against the specified regular expressions and at least one of the"
59       " regular "
60       "expressions has to match, otherwise the test will fail.\n"
61       "  Example: PASS_REGULAR_EXPRESSION \"TestPassed;All ok\"\n"
62       "FAIL_REGULAR_EXPRESSION: If set, if the output will match to one of "
63       "specified regular expressions, the test will fail.\n"
64       "  Example: PASS_REGULAR_EXPRESSION \"[^a-z]Error;ERROR;Failed\"\n"
65       "Both PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION expect a "
66       "list of regular expressions.\n"
67       "TIMEOUT: Setting this will limit the test runtime to the number of "
68       "seconds specified.\n";
69     }
70
71   cmTypeMacro(cmSetTestsPropertiesCommand, cmCommand);
72
73   static bool SetOneTest(const char *tname,
74                          std::vector<std::string> &propertyPairs,
75                          cmMakefile *mf,
76                          std::string &errors);
77 };
78
79
80
81 #endif