cmCTestScriptHandler.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. 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 cmCTestScriptHandler_h
  14. #define cmCTestScriptHandler_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmListFileCache.h"
  17. class cmMakefile;
  18. class cmLocalGenerator;
  19. class cmGlobalGenerator;
  20. class cmake;
  21. /** \class cmCTestScriptHandler
  22. * \brief A class that handles ctest -S invocations
  23. *
  24. */
  25. class cmCTestScriptHandler
  26. {
  27. public:
  28. /**
  29. * Add a script to run
  30. */
  31. void AddConfigurationScript(const char *);
  32. /**
  33. * Run a dashboard using a specified confiuration script
  34. */
  35. int RunConfigurationScript();
  36. /*
  37. * If verbose then more informaiton is printed out
  38. */
  39. void SetVerbose(bool val) { m_Verbose = val; }
  40. cmCTestScriptHandler();
  41. ~cmCTestScriptHandler();
  42. private:
  43. // reads in a script
  44. int ReadInScript(const std::string& total_script_arg);
  45. // extract vars from the script to set ivars
  46. int ExtractVariables();
  47. // perform a CVS checkout of the source dir
  48. int CheckOutSourceDir();
  49. // perform any extra cvs updates that were requested
  50. int PerformExtraUpdates();
  51. void LocalSleep(unsigned int secondsToWait);
  52. // backup and restore dirs
  53. int BackupDirectories();
  54. void RestoreBackupDirectories();
  55. int RunConfigurationScript(const std::string& script);
  56. int RunConfigurationDashboard();
  57. std::vector<cmStdString> m_ConfigurationScripts;
  58. bool m_Verbose;
  59. bool m_Backup;
  60. cmStdString m_SourceDir;
  61. cmStdString m_BinaryDir;
  62. cmStdString m_BackupSourceDir;
  63. cmStdString m_BackupBinaryDir;
  64. cmStdString m_CTestRoot;
  65. cmStdString m_CVSCheckOut;
  66. cmStdString m_CTestCmd;
  67. cmStdString m_CVSCmd;
  68. double m_MinimumInterval;
  69. cmMakefile *m_Makefile;
  70. cmLocalGenerator *m_LocalGenerator;
  71. cmGlobalGenerator *m_GlobalGenerator;
  72. cmake *m_CMake;
  73. };
  74. #endif