diff options
author | Zach Mullen <zach.mullen@kitware.com> | 2011-01-03 16:25:46 (GMT) |
---|---|---|
committer | Zach Mullen <zach.mullen@kitware.com> | 2011-01-03 16:25:46 (GMT) |
commit | 6b0c7ded5777c5b4c703bbe59be5c6afcebb879d (patch) | |
tree | 5927fef4d46f4f9ae9c8709421f60b0ab147afba /Source/CTest | |
parent | edff9207ed82d241077d66b20087657f74e8b5b9 (diff) | |
download | CMake-6b0c7ded5777c5b4c703bbe59be5c6afcebb879d.zip CMake-6b0c7ded5777c5b4c703bbe59be5c6afcebb879d.tar.gz CMake-6b0c7ded5777c5b4c703bbe59be5c6afcebb879d.tar.bz2 |
Support explicitly set test costs in non-parallel testing.
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 94614cf..f3a4457 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -428,7 +428,10 @@ void cmCTestMultiProcessHandler::ReadCostData() if(index == -1) continue; this->Properties[index]->PreviousRuns = prev; - if(this->Properties[index] && this->Properties[index]->Cost == 0) + // When not running in parallel mode, don't use cost data + if(this->ParallelLevel > 1 && + this->Properties[index] && + this->Properties[index]->Cost == 0) { this->Properties[index]->Cost = cost; } @@ -469,20 +472,19 @@ void cmCTestMultiProcessHandler::CreateTestCostList() { SortedTests.push_back(i->first); - //If the test failed last time, it should be run first, so max the cost - if(std::find(this->LastTestsFailed.begin(), - this->LastTestsFailed.end(), - this->Properties[i->first]->Name) - != this->LastTestsFailed.end()) + //If the test failed last time, it should be run first, so max the cost. + //Only do this for parallel runs; in non-parallel runs, avoid clobbering + //the test's explicitly set cost. + if(this->ParallelLevel > 1 && + std::find(this->LastTestsFailed.begin(), this->LastTestsFailed.end(), + this->Properties[i->first]->Name) != this->LastTestsFailed.end()) { this->Properties[i->first]->Cost = FLT_MAX; } } - if(this->ParallelLevel > 1) - { - TestComparator comp(this); - std::sort(SortedTests.begin(), SortedTests.end(), comp); - } + + TestComparator comp(this); + std::sort(SortedTests.begin(), SortedTests.end(), comp); } //--------------------------------------------------------- |