1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmSetTestsPropertiesCommand.h,v $
6 Date: $Date: 2009-09-08 17:39:13 $
7 Version: $Revision: 1.12 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. 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 =========================================================================*/
17 #ifndef cmSetTestsPropertiesCommand_h
18 #define cmSetTestsPropertiesCommand_h
20 #include "cmCommand.h"
22 class cmSetTestsPropertiesCommand
: public cmCommand
25 virtual cmCommand
* Clone()
27 return new cmSetTestsPropertiesCommand
;
31 * This is called when the command is first encountered in
34 virtual bool InitialPass(std::vector
<std::string
> const& args
,
35 cmExecutionStatus
&status
);
38 * The name of the command as specified in CMakeList.txt.
40 virtual const char* GetName() { return "set_tests_properties";}
43 * Succinct documentation.
45 virtual const char* GetTerseDocumentation()
47 return "Set a property of the tests.";
51 * Longer documentation.
53 virtual const char* GetFullDocumentation()
56 " set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2"
58 "Set a property for the tests. If the property is not found, CMake "
59 "will report an error. The properties include:\n"
60 "WILL_FAIL: If set to true, this will invert the pass/fail flag of the"
62 "PASS_REGULAR_EXPRESSION: If set, the test output will be checked "
63 "against the specified regular expressions and at least one of the"
65 "expressions has to match, otherwise the test will fail.\n"
66 " Example: PASS_REGULAR_EXPRESSION \"TestPassed;All ok\"\n"
67 "FAIL_REGULAR_EXPRESSION: If set, if the output will match to one of "
68 "specified regular expressions, the test will fail.\n"
69 " Example: PASS_REGULAR_EXPRESSION \"[^a-z]Error;ERROR;Failed\"\n"
70 "Both PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION expect a "
71 "list of regular expressions.\n"
72 "PROCESSORS: Denotes the number of processors that this test will "
73 "require. This is typically used for MPI tests, and should be used in "
74 "conjunction with the ctest_test PARALLEL_LEVEL option.\n"
75 "COST: Set this to a floating point value. Tests in a test set will be "
76 "run in descending order of cost.\n"
77 "RUN_SERIAL: If set to true, this test will not run in parallel with "
78 "any other tests. This should be used in conjunction with "
79 "the ctest_test PARALLEL_LEVEL option.\n";
82 cmTypeMacro(cmSetTestsPropertiesCommand
, cmCommand
);
84 static bool SetOneTest(const char *tname
,
85 std::vector
<std::string
> &propertyPairs
,