diff options
author | Betsy McPhail <betsy.mcphail@kitware.com> | 2015-06-09 12:50:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-06-30 14:21:37 (GMT) |
commit | f62d301b9257542f5460902c400af3f947f10a66 (patch) | |
tree | 8d21c57b3f3e7b5187b8c56781d7549cf0f93f47 /Source/CTest/cmCTestMultiProcessHandler.h | |
parent | 07c550caa20d4b1d6ebc08269d744ff6a45c0a6d (diff) | |
download | CMake-f62d301b9257542f5460902c400af3f947f10a66.zip CMake-f62d301b9257542f5460902c400af3f947f10a66.tar.gz CMake-f62d301b9257542f5460902c400af3f947f10a66.tar.bz2 |
ctest: Optionally avoid starting tests that may exceed a given CPU load
Add a TestLoad setting to CTest that can be set via a new --test-load
command-line option, CTEST_TEST_LOAD variable, or TEST_LOAD option to
the ctest_test command. Teach cmCTestMultiProcessHandler to measure
the CPU load and avoid starting tests that may take more than the
spare load currently available. The expression
<current_load> + <test_processors> <= <max-load>
must be true to start a new test.
Co-Author: Zack Galbreath <zack.galbreath@kitware.com>
Diffstat (limited to 'Source/CTest/cmCTestMultiProcessHandler.h')
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h index 243318f..ed3e155 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.h +++ b/Source/CTest/cmCTestMultiProcessHandler.h @@ -37,6 +37,7 @@ public: void SetTests(TestMap& tests, PropertiesMap& properties); // Set the max number of tests that can be run at the same time. void SetParallelLevel(size_t); + void SetTestLoad(unsigned long load); virtual void RunTests(); void PrintTestList(); void PrintLabels(); @@ -93,6 +94,7 @@ protected: bool CheckCycles(); int FindMaxIndex(); inline size_t GetProcessorsUsed(int index); + std::string GetName(int index); void LockResources(int index); void UnlockResources(int index); @@ -116,6 +118,7 @@ protected: std::set<std::string> LockedResources; std::vector<cmCTestTestHandler::cmCTestTestResult>* TestResults; size_t ParallelLevel; // max number of process that can be run at once + unsigned long TestLoad; std::set<cmCTestRunTest*> RunningTests; // current running tests cmCTestTestHandler * TestHandler; cmCTest* CTest; |