diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2020-04-13 10:11:31 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2020-04-17 08:00:03 (GMT) |
commit | aacd4e4a90a3afb23d681063d2ecba719f1adab8 (patch) | |
tree | 7e1a884cb47519099bd5db178681773f82dad688 /Source/CTest/cmCTestTestHandler.cxx | |
parent | 9a450bcfec5411169007d5ca5f1bd40e6f476ff4 (diff) | |
download | CMake-aacd4e4a90a3afb23d681063d2ecba719f1adab8.zip CMake-aacd4e4a90a3afb23d681063d2ecba719f1adab8.tar.gz CMake-aacd4e4a90a3afb23d681063d2ecba719f1adab8.tar.bz2 |
Refactoring: add cm::contains to <cmext/algorithm>
Diffstat (limited to 'Source/CTest/cmCTestTestHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index ca65946..7f21633 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -19,6 +19,7 @@ #include <cm/memory> #include <cm/string_view> +#include <cmext/algorithm> #include "cmsys/FStream.hxx" #include <cmsys/Base64.h> @@ -28,7 +29,6 @@ #include "cm_static_string_view.hxx" #include "cm_utf8.h" -#include "cmAlgorithms.h" #include "cmCTest.h" #include "cmCTestMultiProcessHandler.h" #include "cmCTestResourceGroupsLexerHelper.h" @@ -711,7 +711,7 @@ void cmCTestTestHandler::PrintLabelOrSubprojectSummary(bool doSubProject) cmCTestTestProperties& p = *result.Properties; for (std::string const& l : p.Labels) { // only use labels found in labels - if (cmContains(labels, l)) { + if (cm::contains(labels, l)) { labelTimes[l] += result.ExecutionTime.count() * result.Properties->Processors; ++labelCounts[l]; @@ -853,14 +853,15 @@ void cmCTestTestHandler::ComputeTestList() if (this->UseUnion) { // if it is not in the list and not in the regexp then skip - if ((!this->TestsToRun.empty() && !cmContains(this->TestsToRun, cnt)) && + if ((!this->TestsToRun.empty() && + !cm::contains(this->TestsToRun, cnt)) && !tp.IsInBasedOnREOptions) { continue; } } else { // is this test in the list of tests to run? If not then skip it if ((!this->TestsToRun.empty() && - !cmContains(this->TestsToRun, inREcnt)) || + !cm::contains(this->TestsToRun, inREcnt)) || !tp.IsInBasedOnREOptions) { continue; } @@ -889,7 +890,7 @@ void cmCTestTestHandler::ComputeTestListForRerunFailed() cnt++; // if this test is not in our list of tests to run, then skip it. - if (!this->TestsToRun.empty() && !cmContains(this->TestsToRun, cnt)) { + if (!this->TestsToRun.empty() && !cm::contains(this->TestsToRun, cnt)) { continue; } @@ -1008,7 +1009,7 @@ void cmCTestTestHandler::UpdateForFixtures(ListOfTests& tests) const for (auto sIt = setupRange.first; sIt != setupRange.second; ++sIt) { const std::string& setupTestName = sIt->second->Name; tests[i].RequireSuccessDepends.insert(setupTestName); - if (!cmContains(tests[i].Depends, setupTestName)) { + if (!cm::contains(tests[i].Depends, setupTestName)) { tests[i].Depends.push_back(setupTestName); } } @@ -1112,7 +1113,7 @@ void cmCTestTestHandler::UpdateForFixtures(ListOfTests& tests) const const std::vector<size_t>& indices = cIt->second; for (size_t index : indices) { const std::string& reqTestName = tests[index].Name; - if (!cmContains(p.Depends, reqTestName)) { + if (!cm::contains(p.Depends, reqTestName)) { p.Depends.push_back(reqTestName); } } @@ -1125,7 +1126,7 @@ void cmCTestTestHandler::UpdateForFixtures(ListOfTests& tests) const const std::vector<size_t>& indices = cIt->second; for (size_t index : indices) { const std::string& setupTestName = tests[index].Name; - if (!cmContains(p.Depends, setupTestName)) { + if (!cm::contains(p.Depends, setupTestName)) { p.Depends.push_back(setupTestName); } } |