diff options
author | Brad King <brad.king@kitware.com> | 2022-04-06 16:02:05 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-04-06 16:02:05 -0400 |
commit | 75e81733223f1c90cf48879431483d45473b9865 (patch) | |
tree | df6b7b7d648ed36748612662dbc0866eb02ee427 /Source/CTest | |
parent | 2646d5dfcfc4c2dd8a0824de2db5c6888476fcec (diff) | |
download | cmake-75e81733223f1c90cf48879431483d45473b9865.tar.gz |
Source: Fix clang -Wunused-but-set-variable warnings
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 6 | ||||
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 7 |
3 files changed, 2 insertions, 13 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 1b2f769881..aef58c5180 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -1218,11 +1218,8 @@ int cmCTestCoverageHandler::HandleGCovCoverage( cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open file: " << gcovFile << std::endl); } else { - long cnt = -1; std::string nl; while (cmSystemTools::GetLineFromStream(ifile, nl)) { - cnt++; - // Skip empty lines if (nl.empty()) { continue; @@ -1528,7 +1525,6 @@ int cmCTestCoverageHandler::HandleLCovCoverage( cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open file: " << lcovFile << std::endl); } else { - long cnt = -1; std::string nl; // Skip the first line @@ -1537,8 +1533,6 @@ int cmCTestCoverageHandler::HandleLCovCoverage( "File is ready, start reading." << std::endl, this->Quiet); while (cmSystemTools::GetLineFromStream(ifile, nl)) { - cnt++; - // Skip empty lines if (nl.empty()) { continue; diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index d90c4a6465..abd1aa67c9 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -1284,10 +1284,8 @@ void cmCTestMultiProcessHandler::PrintTestList() } this->TestHandler->SetMaxIndex(this->FindMaxIndex()); - int count = 0; for (auto& it : this->Properties) { - count++; cmCTestTestHandler::cmCTestTestProperties& p = *it.second; // Don't worry if this fails, we are only showing the test list, not diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index a794e3d33e..696a5ea081 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -2486,22 +2486,19 @@ bool cmCTestTestHandler::WriteJUnitXML() // Iterate over the test results to get the number of tests that // passed, failed, etc. auto num_tests = 0; - auto num_passed = 0; auto num_failed = 0; auto num_notrun = 0; auto num_disabled = 0; SetOfTests resultsSet(this->TestResults.begin(), this->TestResults.end()); for (cmCTestTestResult const& result : resultsSet) { num_tests++; - if (result.Status == cmCTestTestHandler::COMPLETED) { - num_passed++; - } else if (result.Status == cmCTestTestHandler::NOT_RUN) { + if (result.Status == cmCTestTestHandler::NOT_RUN) { if (result.CompletionStatus == "Disabled") { num_disabled++; } else { num_notrun++; } - } else { + } else if (result.Status != cmCTestTestHandler::COMPLETED) { num_failed++; } } |