浏览代码

Handle multiple carriage return issue on windows VS9. Also make sure that running ctest in showonly mode does not kill our cost store, since many ctest tests do this and corrupt our cost data.

Zach Mullen 16 年之前
父节点
当前提交
2921fa96ed
共有 2 个文件被更改,包括 9 次插入3 次删除
  1. 5 2
      Source/CTest/cmCTestMultiProcessHandler.cxx
  2. 4 1
      Source/CTest/cmProcess.cxx

+ 5 - 2
Source/CTest/cmCTestMultiProcessHandler.cxx

@@ -43,8 +43,11 @@ cmCTestMultiProcessHandler::SetTests(TestMap& tests,
     this->TestRunningMap[i->first] = false;
     this->TestRunningMap[i->first] = false;
     this->TestFinishMap[i->first] = false;
     this->TestFinishMap[i->first] = false;
     }
     }
-  this->ReadCostData();
-  this->CreateTestCostList();
+  if(!this->CTest->GetShowOnly())
+    {
+    this->ReadCostData();
+    this->CreateTestCostList();
+    }
 }
 }
 
 
   // Set the max number of tests that can be run at the same time.
   // Set the max number of tests that can be run at the same time.

+ 4 - 1
Source/CTest/cmProcess.cxx

@@ -79,7 +79,10 @@ bool cmProcess::Buffer::GetLine(std::string& line)
       // Extract the range first..last as a line.
       // Extract the range first..last as a line.
       const char* text = &*this->begin() + this->First;
       const char* text = &*this->begin() + this->First;
       size_type length = this->Last - this->First;
       size_type length = this->Last - this->First;
-      length -= (length && text[length-1] == '\r')? 1:0;
+      while(length && text[length-1] == '\r')
+        {
+        length --;
+        }
       line.assign(text, length);
       line.assign(text, length);
 
 
       // Start a new range for the next line.
       // Start a new range for the next line.