From 5292b3edefa0a6758a8093d78dea4f80b5332de0 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Fri, 4 Jul 2008 10:28:22 -0400 Subject: [PATCH] COMP: try to fix sgi compiler problem with set and also shorten symbol lengths for set class --- Source/CTest/cmCTestMultiProcessHandler.cxx | 20 ++++++++++---------- Source/CTest/cmCTestMultiProcessHandler.h | 6 ++++-- Source/CTest/cmCTestTestHandler.cxx | 4 ++-- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 10434d55c..dff0e9140 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -27,11 +27,11 @@ cmCTestMultiProcessHandler::cmCTestMultiProcessHandler() } // Set the tests void -cmCTestMultiProcessHandler::SetTests(std::map >& tests, - std::map& testNames) +cmCTestMultiProcessHandler::SetTests(TestMap& tests, + std::map& testNames) { // set test run map to false for all - for(std::map >::iterator i = this->Tests.begin(); + for(TestMap::iterator i = this->Tests.begin(); i != this->Tests.end(); ++i) { this->TestRunningMap[i->first] = false; @@ -118,11 +118,11 @@ bool cmCTestMultiProcessHandler::StartTest(int test) // copy the depend tests locally because when // a test is finished it will be removed from the depend list // and we don't want to be iterating a list while removing from it - std::set depends = this->Tests[test]; + TestSet depends = this->Tests[test]; size_t totalDepends = depends.size(); if(totalDepends) { - for(std::set::const_iterator i = depends.begin(); + for(TestSet::const_iterator i = depends.begin(); i != depends.end(); ++i) { // if the test is not already running then start it @@ -166,8 +166,8 @@ void cmCTestMultiProcessHandler::StartNextTests() { return; } - std::map > tests = this->Tests; - for(std::map >::iterator i = tests.begin(); + TestMap tests = this->Tests; + for(TestMap::iterator i = tests.begin(); i != tests.end(); ++i) { // start test should start only one test @@ -254,7 +254,7 @@ void cmCTestMultiProcessHandler::EndTest(cmProcess* p) } this->TestResults->push_back(cres); // remove test from depend of all other tests - for( std::map >::iterator i = this->Tests.begin(); + for(TestMap::iterator i = this->Tests.begin(); i!= this->Tests.end(); ++i) { i->second.erase(test); @@ -271,11 +271,11 @@ void cmCTestMultiProcessHandler::EndTest(cmProcess* p) void cmCTestMultiProcessHandler::PrintTests() { #undef cout - for( std::map >::iterator i = this->Tests.begin(); + for( TestMap::iterator i = this->Tests.begin(); i!= this->Tests.end(); ++i) { std::cout << "Test " << i->first << " ("; - for(std::set::iterator j = i->second.begin(); + for(TestSet::iterator j = i->second.begin(); j != i->second.end(); ++j) { std::cout << *j << " "; diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h index 9f7976db6..5a4c8dbda 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.h +++ b/Source/CTest/cmCTestMultiProcessHandler.h @@ -33,9 +33,11 @@ class cmProcess; class cmCTestMultiProcessHandler { public: + struct TestSet : public std::set {}; + struct TestMap : public std::map {}; cmCTestMultiProcessHandler(); // Set the tests - void SetTests(std::map >& tests, + void SetTests(TestMap& tests, std::map& testNames); // Set the max number of tests that can be run at the same time. void SetParallelLevel(size_t); @@ -66,7 +68,7 @@ protected: // check all running processes for output and exit case bool CheckOutput(); // map from test number to set of depend tests - std::map > Tests; + TestMap Tests; std::map TestNames; std::map TestRunningMap; std::map TestFinishMap; diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index bec9543e6..d2c8edfd1 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1237,8 +1237,8 @@ void cmCTestTestHandler::ProcessParallel(std::vector &passed, cmCTestMultiProcessHandler parallel; parallel.SetCTest(this->CTest); parallel.SetParallelLevel(this->CTest->GetParallelLevel()); - std::set depends; - std::map > tests; + cmCTestMultiProcessHandler::TestSet depends; + cmCTestMultiProcessHandler::TestMap tests; std::map testnames; for (ListOfTests::iterator it = this->TestList.begin(); it != this->TestList.end(); it ++ )