diff options
author | Zach Mullen <zach.mullen@kitware.com> | 2009-08-26 16:09:06 (GMT) |
---|---|---|
committer | Zach Mullen <zach.mullen@kitware.com> | 2009-08-26 16:09:06 (GMT) |
commit | 8ffd8d0a03d68241ce4f5f8a9fd266bee1032e1d (patch) | |
tree | 744b5e713b143008ec4ddcd8670bd47082658c05 /Source/CTest/cmCTestRunTest.h | |
parent | 1171bcfc697f6196c8f31018153217e5de779e60 (diff) | |
download | CMake-8ffd8d0a03d68241ce4f5f8a9fd266bee1032e1d.zip CMake-8ffd8d0a03d68241ce4f5f8a9fd266bee1032e1d.tar.gz CMake-8ffd8d0a03d68241ce4f5f8a9fd266bee1032e1d.tar.bz2 |
ENH: refactored ctest. All testing is now parallel. If no -j option is specified, defaults to a MP level of 1 (non parallel)
Diffstat (limited to 'Source/CTest/cmCTestRunTest.h')
-rw-r--r-- | Source/CTest/cmCTestRunTest.h | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h index 1438a60..72a108a 100644 --- a/Source/CTest/cmCTestRunTest.h +++ b/Source/CTest/cmCTestRunTest.h @@ -19,6 +19,7 @@ #include <cmStandardIncludes.h> #include <cmCTestTestHandler.h> +#include <cmProcess.h> /** \class cmRunTest * \brief represents a single test to be run @@ -38,44 +39,53 @@ public: { return this->TestProperties; } void SetTestHandler(cmCTestTestHandler * handler); - - void SetOptimizeForCTest(bool optimize) - { this->OptimizeForCTest = optimize; } - bool GetOptimizeForCTest() - { return this->OptimizeForCTest; } + void SetIndex(int i) { this->Index = i; } + + void SetCTest(cmCTest * ct) { this->CTest = ct; } - std::string GetProcessOutput() - { return this->ProcessOutput; } + int GetIndex() { return this->Index; } - //Provides a handle to the log stream in case someone wants - // to asynchronously process the log - std::ostream * GetLogStream() - { return this->TestHandler->LogFile; } + std::string GetProcessOutput() { return this->ProcessOutput; } cmCTestTestHandler::cmCTestTestResult GetTestResults() { return this->TestResult; } - //Runs the test - bool Execute(); + bool IsRunning(); + void CheckOutput(); + //launch the test process, return whether it started correctly + bool StartTest(); + //capture the test results and send them back to the test handler + bool EndTest(); protected: - void DartProcessing(std::string& output); - int RunTestProcess(std::vector<const char*> argv, - std::string* output, int *retVal, - std::ostream* log, double testTimeOut, + void DartProcessing(); + bool CreateProcess(std::string executable, + std::vector<std::string> args, + double testTimeOut, std::vector<std::string>* environment); private: cmCTestTestHandler::cmCTestTestProperties * TestProperties; //Pointer back to the "parent"; the handler that invoked this test run cmCTestTestHandler * TestHandler; cmCTest * CTest; + cmProcess * TestProcess; //If the executable to run is ctest, don't create a new process; //just instantiate a new cmTest. (Can be disabled for a single test //if this option is set to false.) - bool OptimizeForCTest; + //bool OptimizeForCTest; + + //flag for whether the env was modified for this run + bool ModifyEnv; + //stores the original environment if we are modifying it + std::vector<std::string> OrigEnv; std::string ProcessOutput; //The test results cmCTestTestHandler::cmCTestTestResult TestResult; + int Index; + std::string StartTime; + std::string TestCommand; + std::string ActualCommand; + void WriteLogOutputTop(); }; #endif |