123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- #ifndef cmCTestScriptHandler_h
- #define cmCTestScriptHandler_h
- #include "cmConfigure.h"
- #include "cmCTestGenericHandler.h"
- #include "cmDuration.h"
- #include <chrono>
- #include <string>
- #include <vector>
- class cmCTest;
- class cmCTestCommand;
- class cmGlobalGenerator;
- class cmMakefile;
- class cmake;
- class cmCTestScriptHandler : public cmCTestGenericHandler
- {
- public:
- typedef cmCTestGenericHandler Superclass;
-
- void AddConfigurationScript(const char*, bool pscope);
-
- int ProcessHandler() override;
-
- static bool RunScript(cmCTest* ctest, const char* script, bool InProcess,
- int* returnValue);
- int RunCurrentScript();
-
- static bool EmptyBinaryDirectory(const char* dir);
-
- static bool WriteInitialCache(const char* directory, const char* text);
-
- static void SleepInSeconds(unsigned int secondsToWait);
- void UpdateElapsedTime();
-
- cmDuration GetRemainingTimeAllowed();
- cmCTestScriptHandler();
- ~cmCTestScriptHandler() override;
- void Initialize() override;
- void CreateCMake();
- cmake* GetCMake() { return this->CMake; }
- void SetRunCurrentScript(bool value);
- private:
-
- int ReadInScript(const std::string& total_script_arg);
- int ExecuteScript(const std::string& total_script_arg);
-
- int ExtractVariables();
-
- int CheckOutSourceDir();
-
- int PerformExtraUpdates();
-
- int BackupDirectories();
- void RestoreBackupDirectories();
- int RunConfigurationScript(const std::string& script, bool pscope);
- int RunConfigurationDashboard();
-
- void AddCTestCommand(std::string const& name, cmCTestCommand* command);
-
- static bool TryToRemoveBinaryDirectoryOnce(const std::string& directoryPath);
- std::vector<std::string> ConfigurationScripts;
- std::vector<bool> ScriptProcessScope;
- bool ShouldRunCurrentScript;
- bool Backup;
- bool EmptyBinDir;
- bool EmptyBinDirOnce;
- std::string SourceDir;
- std::string BinaryDir;
- std::string BackupSourceDir;
- std::string BackupBinaryDir;
- std::string CTestRoot;
- std::string CVSCheckOut;
- std::string CTestCmd;
- std::string UpdateCmd;
- std::string CTestEnv;
- std::string InitialCache;
- std::string CMakeCmd;
- std::string CMOutFile;
- std::vector<std::string> ExtraUpdates;
- double MinimumInterval;
- double ContinuousDuration;
-
- std::chrono::steady_clock::time_point ScriptStartTime;
- cmMakefile* Makefile;
- cmGlobalGenerator* GlobalGenerator;
- cmake* CMake;
- };
- #endif
|