cmSetTestsPropertiesCommand.h 3.1 KB

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