diff options
author | Brad King <brad.king@kitware.com> | 2011-01-04 20:46:16 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2011-01-04 20:46:16 (GMT) |
commit | d04e10dd7ef0f756cfe0371f25554deb54353265 (patch) | |
tree | 23c252f2a0230bb69a7e390d934574e23d1fbf74 /Source/CTest | |
parent | 70950edde06305f9bfcb2f6bfd5442add72dc947 (diff) | |
parent | 6b0c7ded5777c5b4c703bbe59be5c6afcebb879d (diff) | |
download | CMake-d04e10dd7ef0f756cfe0371f25554deb54353265.zip CMake-d04e10dd7ef0f756cfe0371f25554deb54353265.tar.gz CMake-d04e10dd7ef0f756cfe0371f25554deb54353265.tar.bz2 |
Merge topic 'negative-test-costs'
6b0c7de 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); } //--------------------------------------------------------- |