cmSetTestsPropertiesCommand.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmSetTestsPropertiesCommand_h
  11. #define cmSetTestsPropertiesCommand_h
  12. #include "cmCommand.h"
  13. class cmSetTestsPropertiesCommand : public cmCommand
  14. {
  15. public:
  16. virtual cmCommand* Clone()
  17. {
  18. return new cmSetTestsPropertiesCommand;
  19. }
  20. /**
  21. * This is called when the command is first encountered in
  22. * the input file.
  23. */
  24. virtual bool InitialPass(std::vector<std::string> const& args,
  25. cmExecutionStatus &status);
  26. /**
  27. * The name of the command as specified in CMakeList.txt.
  28. */
  29. virtual const char* GetName() { return "set_tests_properties";}
  30. /**
  31. * Succinct documentation.
  32. */
  33. virtual const char* GetTerseDocumentation()
  34. {
  35. return "Set a property of the tests.";
  36. }
  37. /**
  38. * Longer documentation.
  39. */
  40. virtual const char* GetFullDocumentation()
  41. {
  42. return
  43. " set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2"
  44. " value2)\n"
  45. "Set a property for the tests. If the property is not found, CMake "
  46. "will report an error. The properties include:\n"
  47. "WILL_FAIL: If set to true, this will invert the pass/fail flag of the"
  48. " test.\n"
  49. "PASS_REGULAR_EXPRESSION: If set, the test output will be checked "
  50. "against the specified regular expressions and at least one of the"
  51. " regular "
  52. "expressions has to match, otherwise the test will fail.\n"
  53. " Example: PASS_REGULAR_EXPRESSION \"TestPassed;All ok\"\n"
  54. "FAIL_REGULAR_EXPRESSION: If set, if the output will match to one of "
  55. "specified regular expressions, the test will fail.\n"
  56. " Example: PASS_REGULAR_EXPRESSION \"[^a-z]Error;ERROR;Failed\"\n"
  57. "Both PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION expect a "
  58. "list of regular expressions.\n"
  59. "PROCESSORS: Denotes the number of processors that this test will "
  60. "require. This is typically used for MPI tests, and should be used in "
  61. "conjunction with the ctest_test PARALLEL_LEVEL option.\n"
  62. "COST: Set this to a floating point value. Tests in a test set will be "
  63. "run in descending order of cost.\n"
  64. "TIMEOUT: Setting this will limit the test runtime to the number of "
  65. "seconds specified.\n"
  66. "RUN_SERIAL: If set to true, this test will not run in parallel with "
  67. "any other tests. This should be used in conjunction with "
  68. "the ctest_test PARALLEL_LEVEL option.\n";
  69. }
  70. cmTypeMacro(cmSetTestsPropertiesCommand, cmCommand);
  71. static bool SetOneTest(const char *tname,
  72. std::vector<std::string> &propertyPairs,
  73. cmMakefile *mf,
  74. std::string &errors);
  75. };
  76. #endif