File fix-upstream-test-fails.patch of Package cmake.10858

From 202a44a4cab0ebf2c89fb878cd2ee634fb83906c Mon Sep 17 00:00:00 2001
From: Ben Boeckel <ben.boeckel@kitware.com>
Date: Fri, 21 Apr 2017 14:26:21 -0400
Subject: [PATCH] cmCTestRunTest: do not count skipped tests as failed

Skipped tests are neither passed nor failed tests, but return codes are
based only upon failed tests, so do not count them as such.

Fixes #16822.
---
 Source/CTest/cmCTestRunTest.cxx | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Index: cmake-3.5.2/Source/CTest/cmCTestRunTest.cxx
===================================================================
--- cmake-3.5.2.orig/Source/CTest/cmCTestRunTest.cxx
+++ cmake-3.5.2/Source/CTest/cmCTestRunTest.cxx
@@ -156,6 +156,7 @@ bool cmCTestRunTest::EndTest(size_t comp
   std::vector<std::pair<cmsys::RegularExpression,
     std::string> >::iterator passIt;
   bool forceFail = false;
+  bool skipped = false;
   bool outputTestErrorsToConsole = false;
   if (!this->TestProperties->RequiredRegularExpressions.empty())
     {
@@ -213,6 +214,7 @@ bool cmCTestRunTest::EndTest(size_t comp
       {
       this->TestResult.Status = cmCTestTestHandler::NOT_RUN;
       cmCTestLog(this->CTest, HANDLER_OUTPUT, "***Skipped ");
+      skipped = true;
       }
     else if((success && !this->TestProperties->WillFail)
       || (!success && this->TestProperties->WillFail))
@@ -354,7 +356,9 @@ bool cmCTestRunTest::EndTest(size_t comp
       : this->ProcessOutput;
     this->TestResult.CompressOutput = compress;
     this->TestResult.ReturnValue = this->TestProcess->GetExitValue();
-    this->TestResult.CompletionStatus = "Completed";
+    if (!skipped) {
+      this->TestResult.CompletionStatus = "Completed";
+    }
     this->TestResult.ExecutionTime = this->TestProcess->GetTotalTime();
     this->MemCheckPostProcess();
     this->ComputeWeightedCost();
@@ -366,7 +370,7 @@ bool cmCTestRunTest::EndTest(size_t comp
     this->TestHandler->TestResults.push_back(this->TestResult);
     }
   delete this->TestProcess;
-  return passed;
+  return passed || skipped;
 }
 
 bool cmCTestRunTest::StartAgain()
openSUSE Build Service is sponsored by