summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestScriptHandler.h
blob: acddad24a5050b06f271091d86ea6f0304bb8c16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*=========================================================================

  Program:   CMake - Cross-Platform Makefile Generator
  Module:    $RCSfile$
  Language:  C++
  Date:      $Date$
  Version:   $Revision$

  Copyright (c) 2002 Kitware, Inc. All rights reserved.
  See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/

#ifndef cmCTestScriptHandler_h
#define cmCTestScriptHandler_h


#include "cmStandardIncludes.h"
#include "cmListFileCache.h"

class cmMakefile;
class cmLocalGenerator;
class cmGlobalGenerator;
class cmake;

/** \class cmCTestScriptHandler
 * \brief A class that handles ctest -S invocations
 *
 */
class cmCTestScriptHandler
{
public:

  /**
   * Add a script to run
   */
  void AddConfigurationScript(const char *);
  
  /**
   * Run a dashboard using a specified confiuration script
   */
  int RunConfigurationScript();

  /*
   * If verbose then more informaiton is printed out
   */
  void SetVerbose(bool val) { m_Verbose = val; }
  
  cmCTestScriptHandler();
  ~cmCTestScriptHandler();
  
private:
  // reads in a script
  int ReadInScript(const std::string& total_script_arg);

  // extract vars from the script to set ivars
  int ExtractVariables();

  // perform a CVS checkout of the source dir
  int CheckOutSourceDir();

  // perform any extra cvs updates that were requested
  int PerformExtraUpdates();
  
  void LocalSleep(unsigned int secondsToWait);

  // backup and restore dirs
  int BackupDirectories();
  void RestoreBackupDirectories();

  int RunConfigurationScript(const std::string& script);
  int RunConfigurationDashboard();

  std::vector<cmStdString> m_ConfigurationScripts;

  bool m_Verbose;
  bool m_Backup;

  cmStdString m_SourceDir;
  cmStdString m_BinaryDir;
  cmStdString m_BackupSourceDir;
  cmStdString m_BackupBinaryDir;
  cmStdString m_CTestRoot;
  cmStdString m_CVSCheckOut;
  cmStdString m_CTestCmd;
  cmStdString m_CVSCmd;

  double m_MinimumInterval;
  
  cmMakefile *m_Makefile;
  cmLocalGenerator *m_LocalGenerator;
  cmGlobalGenerator *m_GlobalGenerator;
  cmake *m_CMake;
  
};

#endif