summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2003-12-16 21:19:56 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2003-12-16 21:19:56 (GMT)
commitab0a30e2b3f2fc3fc8d3eacddd7f7e2210faa426 (patch)
treefac9feaa9d40fa3106fe0f38079cdfcbfbfa2147 /Source/cmCTest.cxx
parent4cf81bab0e84c1ccc922c1bd121894072f1561cf (diff)
downloadCMake-ab0a30e2b3f2fc3fc8d3eacddd7f7e2210faa426.zip
CMake-ab0a30e2b3f2fc3fc8d3eacddd7f7e2210faa426.tar.gz
CMake-ab0a30e2b3f2fc3fc8d3eacddd7f7e2210faa426.tar.bz2
ENH: Add suppression file support for valgrind
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 333cc36..c42020a 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1752,6 +1752,7 @@ void cmCTest::ProcessDirectory(cmCTest::tm_VectorOfStrings &passed,
// find the test executable
std::string actualCommand = this->FindTheExecutable(args[1].Value.c_str());
std::string testCommand = cmSystemTools::ConvertToOutputPath(actualCommand.c_str());
+ std::string memcheckcommand = "";
// continue if we did not find the executable
if (testCommand == "")
@@ -1771,9 +1772,12 @@ void cmCTest::ProcessDirectory(cmCTest::tm_VectorOfStrings &passed,
{
cmCTest::tm_VectorOfStrings::size_type pp;
arguments.push_back(m_MemoryTester.c_str());
+ memcheckcommand = m_MemoryTester;
for ( pp = 0; pp < m_MemoryTesterOptionsParsed.size(); pp ++ )
{
arguments.push_back(m_MemoryTesterOptionsParsed[pp].c_str());
+ memcheckcommand += " ";
+ memcheckcommand += cmSystemTools::EscapeSpaces(m_MemoryTesterOptionsParsed[pp].c_str());
}
}
arguments.push_back(actualCommand.c_str());
@@ -1796,7 +1800,11 @@ void cmCTest::ProcessDirectory(cmCTest::tm_VectorOfStrings &passed,
if ( m_Verbose )
{
- std::cout << std::endl << "Test command: " << testCommand << std::endl;
+ std::cout << std::endl << (memcheck?"MemCheck":"Test") << " command: " << testCommand << std::endl;
+ if ( memcheck )
+ {
+ std::cout << "Memory check command: " << memcheckcommand << std::endl;
+ }
}
int res = 0;
if ( !m_ShowOnly )
@@ -1889,6 +1897,7 @@ void cmCTest::ProcessDirectory(cmCTest::tm_VectorOfStrings &passed,
bool cmCTest::InitializeMemoryChecking()
{
+ // Setup the command
if ( cmSystemTools::FileExists(m_DartConfiguration["MemoryCheckCommand"].c_str()) )
{
m_MemoryTester
@@ -1911,6 +1920,7 @@ bool cmCTest::InitializeMemoryChecking()
return false;
}
+ // Setup the options
if ( m_DartConfiguration["MemoryCheckCommandOptions"].size() )
{
m_MemoryTesterOptions = m_DartConfiguration["MemoryCheckCommandOptions"];
@@ -1930,6 +1940,16 @@ bool cmCTest::InitializeMemoryChecking()
{
m_MemoryTesterOptions = "-q --skin=memcheck --leak-check=yes --show-reachable=yes --workaround-gcc296-bugs=yes --num-callers=100";
}
+ if ( m_DartConfiguration["MemoryCheckSuppressionFile"].size() )
+ {
+ if ( !cmSystemTools::FileExists(m_DartConfiguration["MemoryCheckSuppressionFile"].c_str()) )
+ {
+ std::cerr << "Cannot find memory checker suppression file: "
+ << m_DartConfiguration["MemoryCheckSuppressionFile"].c_str() << std::endl;
+ return false;
+ }
+ m_MemoryTesterOptions += " --suppressions=" + cmSystemTools::EscapeSpaces(m_DartConfiguration["MemoryCheckSuppressionFile"].c_str()) + "";
+ }
}
else if ( m_MemoryTester.find("purify") )
{