From 3250cb3d3b5b4ed60e620ff78cad7fa8fb24113f Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Fri, 17 Jul 2009 10:06:38 -0400 Subject: ENH: compute the max test name width based on the length of the tests --- Source/CTest/cmCTestTestHandler.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 4b94567..0dffb26 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1108,6 +1108,21 @@ void cmCTestTestHandler::ComputeTestList() this->TotalNumberOfTests = this->TestList.size(); // Set the TestList to the final list of all test this->TestList = finalList; + std::string::size_type max = this->CTest->GetMaxTestNameWidth(); + for (ListOfTests::iterator it = this->TestList.begin(); + it != this->TestList.end(); it ++ ) + { + cmCTestTestProperties& p = *it; + if(max < p.Name.size()) + { + max = p.Name.size(); + } + } + if(static_cast(this->CTest->GetMaxTestNameWidth()) + != max) + { + this->CTest->SetMaxTestNameWidth(max); + } } bool cmCTestTestHandler::GetValue(const char* tag, -- cgit v0.12