ENH: try and debug the failed test on the continuous

This commit is contained in:
Bill Hoffman 2005-03-03 18:46:52 -05:00
parent ded7d15144
commit 16b65d86c9
5 changed files with 25 additions and 6 deletions

View File

@ -4,6 +4,12 @@
//-------------------------------------------------------------------
cmOrderLinkDirectories::cmOrderLinkDirectories()
{
m_Debug = false;
}
//------------------------------------------------------------------- //-------------------------------------------------------------------
bool cmOrderLinkDirectories::LibraryInDirectory(const char* dir, bool cmOrderLinkDirectories::LibraryInDirectory(const char* dir,
const char* libIn) const char* libIn)
@ -272,7 +278,11 @@ bool cmOrderLinkDirectories::DetermineLibraryPathOrder()
} }
this->FindIndividualLibraryOrders(); this->FindIndividualLibraryOrders();
m_SortedSearchPaths.clear(); m_SortedSearchPaths.clear();
if(m_Debug)
{
this->PrintMap("m_LibraryToDirectories", m_LibraryToDirectories);
this->PrintMap("m_DirectoryToAfterList", m_DirectoryToAfterList);
}
this->OrderPaths(m_SortedSearchPaths); this->OrderPaths(m_SortedSearchPaths);
// now turn libfoo.a into foo and foo.a into foo // now turn libfoo.a into foo and foo.a into foo
// This will prepare the link items for -litem // This will prepare the link items for -litem
@ -317,18 +327,18 @@ void
cmOrderLinkDirectories::PrintMap(const char* name, cmOrderLinkDirectories::PrintMap(const char* name,
std::map<cmStdString, std::vector<cmStdString> >& m) std::map<cmStdString, std::vector<cmStdString> >& m)
{ {
std::cerr << name << "\n"; std::cout << name << "\n";
for(std::map<cmStdString, std::vector<cmStdString> >::iterator i = for(std::map<cmStdString, std::vector<cmStdString> >::iterator i =
m.begin(); i != m.end(); m.begin(); i != m.end();
++i) ++i)
{ {
std::cerr << i->first << ": "; std::cout << i->first << ": ";
for(std::vector<cmStdString>::iterator l = i->second.begin(); for(std::vector<cmStdString>::iterator l = i->second.begin();
l != i->second.end(); ++l) l != i->second.end(); ++l)
{ {
std::cerr << *l << " "; std::cout << *l << " ";
} }
std::cerr << "\n"; std::cout << "\n";
} }
} }

View File

@ -47,6 +47,7 @@
class cmOrderLinkDirectories class cmOrderLinkDirectories
{ {
public: public:
cmOrderLinkDirectories();
///! set link information from the target ///! set link information from the target
void SetLinkInformation(const cmTarget&, cmTarget::LinkLibraryType, void SetLinkInformation(const cmTarget&, cmTarget::LinkLibraryType,
const char* targetLibrary); const char* targetLibrary);
@ -79,6 +80,11 @@ public:
cmStdString Path; cmStdString Path;
}; };
friend struct cmOrderLinkDirectoriesCompare; friend struct cmOrderLinkDirectoriesCompare;
void DebugOn()
{
m_Debug = true;
}
private: private:
void CreateRegularExpressions(); void CreateRegularExpressions();
void DetermineLibraryPathOrder(std::vector<cmStdString>& searchPaths, void DetermineLibraryPathOrder(std::vector<cmStdString>& searchPaths,
@ -119,7 +125,7 @@ private:
cmsys::RegularExpression m_RemoveLibraryExtension; cmsys::RegularExpression m_RemoveLibraryExtension;
cmsys::RegularExpression m_ExtractBaseLibraryName; cmsys::RegularExpression m_ExtractBaseLibraryName;
cmsys::RegularExpression m_ExtractBaseLibraryNameNoPrefix; cmsys::RegularExpression m_ExtractBaseLibraryNameNoPrefix;
bool m_Debug;
}; };
#endif #endif

View File

@ -52,6 +52,7 @@ bool TestLibraryOrder(bool shouldFail)
std::vector<cmStdString> sortedpaths; std::vector<cmStdString> sortedpaths;
std::vector<cmStdString> linkItems; std::vector<cmStdString> linkItems;
cmOrderLinkDirectories orderLibs; cmOrderLinkDirectories orderLibs;
orderLibs.DebugOn();
orderLibs.AddLinkExtension(".so"); orderLibs.AddLinkExtension(".so");
orderLibs.AddLinkExtension(".a"); orderLibs.AddLinkExtension(".a");
orderLibs.SetLinkInformation(target, cmTarget::GENERAL, "A"); orderLibs.SetLinkInformation(target, cmTarget::GENERAL, "A");

View File

@ -52,6 +52,7 @@ bool TestLibraryOrder(bool shouldFail)
std::vector<cmStdString> sortedpaths; std::vector<cmStdString> sortedpaths;
std::vector<cmStdString> linkItems; std::vector<cmStdString> linkItems;
cmOrderLinkDirectories orderLibs; cmOrderLinkDirectories orderLibs;
orderLibs.DebugOn();
orderLibs.AddLinkExtension(".so"); orderLibs.AddLinkExtension(".so");
orderLibs.AddLinkExtension(".a"); orderLibs.AddLinkExtension(".a");
orderLibs.SetLinkInformation(target, cmTarget::GENERAL, "A"); orderLibs.SetLinkInformation(target, cmTarget::GENERAL, "A");

View File

@ -52,6 +52,7 @@ bool TestLibraryOrder(bool shouldFail)
std::vector<cmStdString> sortedpaths; std::vector<cmStdString> sortedpaths;
std::vector<cmStdString> linkItems; std::vector<cmStdString> linkItems;
cmOrderLinkDirectories orderLibs; cmOrderLinkDirectories orderLibs;
orderLibs.DebugOn();
orderLibs.AddLinkExtension(".so"); orderLibs.AddLinkExtension(".so");
orderLibs.AddLinkExtension(".a"); orderLibs.AddLinkExtension(".a");
orderLibs.SetLinkInformation(target, cmTarget::GENERAL, "A"); orderLibs.SetLinkInformation(target, cmTarget::GENERAL, "A");