Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
5b232ded
Commit
5b232ded
authored
Dec 15, 2003
by
Andy Cedilnik
Browse files
ENH: Add initial memory check support which works for Valgrind
parent
ce8a3490
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Modules/Dart.cmake
View file @
5b232ded
...
...
@@ -69,7 +69,9 @@ IF(BUILD_TESTING)
DOC
"Path to program used to compress files for transfer to the dart server"
)
FIND_PROGRAM
(
GUNZIPCOMMAND gunzip DOC
"Path to gunzip executable"
)
FIND_PROGRAM
(
JAVACOMMAND java DOC
"Path to java command, used by the Dart server to create html."
)
FIND_PROGRAM
(
PURIFYCOMMAND purify
FIND_PROGRAM
(
MEMORYCHECK_COMMAND
NAMES purify valgrind boundscheck
PATHS
"[HKEY_LOCAL_MACHINE
\\
SOFTWARE
\\
Rational Software
\\
Purify
\\
Setup;InstallFolder]"
DOC
"Path to Rational purify command, used for memory error detection."
)
...
...
@@ -95,11 +97,25 @@ IF(BUILD_TESTING)
ELSE
(
WIN32
)
SET
(
DART_NAME_COMPONENT
"NAME"
)
ENDIF
(
WIN32
)
SET
(
BUILD_NAME_SYSTEM_NAME
"
${
CMAKE_SYSTEM_NAME
}
"
)
IF
(
WIN32
)
SET
(
BUILD_NAME_SYSTEM_NAME
"Win32"
)
ENDIF
(
WIN32
)
IF
(
UNIX OR BORLAND
)
GET_FILENAME_COMPONENT
(
DART_CXX_NAME
"
${
CMAKE_CXX_COMPILER
}
"
${
DART_NAME_COMPONENT
}
)
ELSE
(
UNIX OR BORLAND
)
GET_FILENAME_COMPONENT
(
DART_CXX_NAME
"
${
CMAKE_BUILD_TOOL
}
"
${
DART_NAME_COMPONENT
}
)
ENDIF
(
UNIX OR BORLAND
)
IF
(
DART_CXX_NAME MATCHES
"msdev"
)
SET
(
DART_CXX_NAME
"vs60"
)
ENDIF
(
DART_CXX_NAME MATCHES
"msdev"
)
IF
(
DART_CXX_NAME MATCHES
"devenv"
)
IF
(
CMAKE_GENERATOR MATCHES
"^Visual Studio 7$"
)
SET
(
DART_CXX_NAME
"vs70"
)
ELSE
(
CMAKE_GENERATOR MATCHES
"^Visual Studio 7$"
)
SET
(
DART_CXX_NAME
"vs71"
)
ENDIF
(
CMAKE_GENERATOR MATCHES
"^Visual Studio 7$"
)
ENDIF
(
DART_CXX_NAME MATCHES
"devenv"
)
SET
(
BUILDNAME
"
${
CMAKE_SYSTEM_NAME
}
-
${
DART_CXX_NAME
}
"
)
MESSAGE
(
STATUS
"Using Buildname:
${
BUILDNAME
}
"
)
ENDIF
(
NOT BUILDNAME
)
...
...
@@ -140,7 +156,7 @@ IF(BUILD_TESTING)
# configure files
CONFIGURE_FILE
(
${
DART_ROOT
}
/Source/Client/
Utility
.conf.in
${
DART_ROOT
}
/Source/Client/
Dart
.conf.in
${
PROJECT_BINARY_DIR
}
/DartConfiguration.tcl
)
#
...
...
Modules/DartConfiguration.tcl.in
View file @
5b232ded
...
...
@@ -40,6 +40,8 @@ ScpCommand: @SCPCOMMAND@
PurifyCommand: @PURIFYCOMMAND@
ValgrindCommand: @VALGRIND_COMMAND@
ValgrindCommandOptions: @VALGRIND_COMMAND_OPTIONS@
MemoryCheckCommand: @MEMORYCHECK_COMMAND@
MemoryCheckCommandOptions: @MEMORYCHECK_COMMAND_OPTIONS@
CoverageCommand: @COVERAGE_COMMAND@
# Compression commands
GunzipCommand: @GUNZIPCOMMAND@
...
...
Source/CTest/cmCTestSubmit.cxx
View file @
5b232ded
...
...
@@ -37,7 +37,7 @@ cmCTestSubmit::cmCTestSubmit() : m_HTTPProxy(), m_FTPProxy()
}
if
(
getenv
(
"HTTP_PROXY_TYPE"
)
)
{
std
::
s
tring
type
=
getenv
(
"HTTP_PROXY_TYPE"
);
cmStdS
tring
type
=
getenv
(
"HTTP_PROXY_TYPE"
);
// HTTP/SOCKS4/SOCKS5
if
(
type
==
"HTTP"
)
{
...
...
@@ -66,7 +66,7 @@ cmCTestSubmit::cmCTestSubmit() : m_HTTPProxy(), m_FTPProxy()
}
if
(
getenv
(
"FTP_PROXY_TYPE"
)
)
{
std
::
s
tring
type
=
getenv
(
"FTP_PROXY_TYPE"
);
cmStdS
tring
type
=
getenv
(
"FTP_PROXY_TYPE"
);
// HTTP/SOCKS4/SOCKS5
if
(
type
==
"HTTP"
)
{
...
...
@@ -92,10 +92,10 @@ cmCTestSubmit::cmCTestSubmit() : m_HTTPProxy(), m_FTPProxy()
}
}
bool
cmCTestSubmit
::
SubmitUsingFTP
(
const
std
::
s
tring
&
localprefix
,
const
std
::
vector
<
std
::
s
tring
>&
files
,
const
std
::
s
tring
&
remoteprefix
,
const
std
::
s
tring
&
url
)
bool
cmCTestSubmit
::
SubmitUsingFTP
(
const
cmStdS
tring
&
localprefix
,
const
std
::
vector
<
cmStdS
tring
>&
files
,
const
cmStdS
tring
&
remoteprefix
,
const
cmStdS
tring
&
url
)
{
CURL
*
curl
;
CURLcode
res
;
...
...
@@ -105,7 +105,7 @@ bool cmCTestSubmit::SubmitUsingFTP(const std::string& localprefix,
/* In windows, this will init the winsock stuff */
::
curl_global_init
(
CURL_GLOBAL_ALL
);
std
::
s
tring
::
size_type
cc
;
cmStdS
tring
::
size_type
cc
;
for
(
cc
=
0
;
cc
<
files
.
size
();
cc
++
)
{
/* get a curl handle */
...
...
@@ -132,8 +132,8 @@ bool cmCTestSubmit::SubmitUsingFTP(const std::string& localprefix,
// enable uploading
::
curl_easy_setopt
(
curl
,
CURLOPT_UPLOAD
,
TRUE
)
;
std
::
s
tring
local_file
=
localprefix
+
"/"
+
files
[
cc
];
std
::
s
tring
upload_as
=
url
+
"/"
+
remoteprefix
+
files
[
cc
];
cmStdS
tring
local_file
=
localprefix
+
"/"
+
files
[
cc
];
cmStdS
tring
upload_as
=
url
+
"/"
+
remoteprefix
+
files
[
cc
];
struct
stat
st
;
if
(
::
stat
(
local_file
.
c_str
(),
&
st
)
)
...
...
@@ -184,10 +184,10 @@ bool cmCTestSubmit::SubmitUsingFTP(const std::string& localprefix,
}
// Uploading files is simpler
bool
cmCTestSubmit
::
SubmitUsingHTTP
(
const
std
::
s
tring
&
localprefix
,
const
std
::
vector
<
std
::
s
tring
>&
files
,
const
std
::
s
tring
&
remoteprefix
,
const
std
::
s
tring
&
url
)
bool
cmCTestSubmit
::
SubmitUsingHTTP
(
const
cmStdS
tring
&
localprefix
,
const
std
::
vector
<
cmStdS
tring
>&
files
,
const
cmStdS
tring
&
remoteprefix
,
const
cmStdS
tring
&
url
)
{
CURL
*
curl
;
CURLcode
res
;
...
...
@@ -196,7 +196,7 @@ bool cmCTestSubmit::SubmitUsingHTTP(const std::string& localprefix,
/* In windows, this will init the winsock stuff */
::
curl_global_init
(
CURL_GLOBAL_ALL
);
std
::
s
tring
::
size_type
cc
,
kk
;
cmStdS
tring
::
size_type
cc
,
kk
;
for
(
cc
=
0
;
cc
<
files
.
size
();
cc
++
)
{
/* get a curl handle */
...
...
@@ -231,9 +231,9 @@ bool cmCTestSubmit::SubmitUsingHTTP(const std::string& localprefix,
::
curl_easy_setopt
(
curl
,
CURLOPT_VERBOSE
,
1
);
}
std
::
s
tring
local_file
=
localprefix
+
"/"
+
files
[
cc
];
std
::
s
tring
remote_file
=
remoteprefix
+
files
[
cc
];
std
::
s
tring
ofile
=
""
;
cmStdS
tring
local_file
=
localprefix
+
"/"
+
files
[
cc
];
cmStdS
tring
remote_file
=
remoteprefix
+
files
[
cc
];
cmStdS
tring
ofile
=
""
;
for
(
kk
=
0
;
kk
<
remote_file
.
size
();
kk
++
)
{
char
c
=
remote_file
[
kk
];
...
...
@@ -256,7 +256,7 @@ bool cmCTestSubmit::SubmitUsingHTTP(const std::string& localprefix,
ofile
.
append
(
hex
);
}
}
std
::
s
tring
upload_as
=
url
+
"?FileName="
+
ofile
;
cmStdS
tring
upload_as
=
url
+
"?FileName="
+
ofile
;
struct
stat
st
;
if
(
::
stat
(
local_file
.
c_str
(),
&
st
)
)
...
...
@@ -301,16 +301,16 @@ bool cmCTestSubmit::SubmitUsingHTTP(const std::string& localprefix,
return
true
;
}
bool
cmCTestSubmit
::
TriggerUsingHTTP
(
const
std
::
vector
<
std
::
s
tring
>&
files
,
const
std
::
s
tring
&
remoteprefix
,
const
std
::
s
tring
&
url
)
bool
cmCTestSubmit
::
TriggerUsingHTTP
(
const
std
::
vector
<
cmStdS
tring
>&
files
,
const
cmStdS
tring
&
remoteprefix
,
const
cmStdS
tring
&
url
)
{
CURL
*
curl
;
/* In windows, this will init the winsock stuff */
::
curl_global_init
(
CURL_GLOBAL_ALL
);
std
::
s
tring
::
size_type
cc
,
kk
;
cmStdS
tring
::
size_type
cc
,
kk
;
for
(
cc
=
0
;
cc
<
files
.
size
();
cc
++
)
{
/* get a curl handle */
...
...
@@ -339,8 +339,8 @@ bool cmCTestSubmit::TriggerUsingHTTP(const std::vector<std::string>& files,
{
::
curl_easy_setopt
(
curl
,
CURLOPT_VERBOSE
,
1
);
}
std
::
s
tring
file
=
remoteprefix
+
files
[
cc
];
std
::
s
tring
ofile
=
""
;
cmStdS
tring
file
=
remoteprefix
+
files
[
cc
];
cmStdS
tring
ofile
=
""
;
for
(
kk
=
0
;
kk
<
file
.
size
();
kk
++
)
{
char
c
=
file
[
kk
];
...
...
@@ -363,7 +363,7 @@ bool cmCTestSubmit::TriggerUsingHTTP(const std::vector<std::string>& files,
ofile
.
append
(
hex
);
}
}
std
::
s
tring
turl
=
url
+
"?xmlfile="
+
ofile
;
cmStdS
tring
turl
=
url
+
"?xmlfile="
+
ofile
;
if
(
m_Verbose
)
{
std
::
cout
<<
" Trigger url: "
<<
turl
.
c_str
()
<<
std
::
endl
;
...
...
@@ -386,10 +386,10 @@ bool cmCTestSubmit::TriggerUsingHTTP(const std::vector<std::string>& files,
return
true
;
}
bool
cmCTestSubmit
::
SubmitUsingSCP
(
const
std
::
s
tring
&
,
const
std
::
vector
<
std
::
s
tring
>&
,
const
std
::
s
tring
&
,
const
std
::
s
tring
&
)
bool
cmCTestSubmit
::
SubmitUsingSCP
(
const
cmStdS
tring
&
,
const
std
::
vector
<
cmStdS
tring
>&
,
const
cmStdS
tring
&
,
const
cmStdS
tring
&
)
{
std
::
cout
<<
"SubmitUsingSCP is not yet implemented"
<<
std
::
endl
;
return
false
;
...
...
Source/CTest/cmCTestSubmit.h
View file @
5b232ded
...
...
@@ -41,27 +41,27 @@ public:
/**
* Submit file using various ways
*/
bool
SubmitUsingFTP
(
const
std
::
s
tring
&
localprefix
,
const
std
::
vector
<
std
::
s
tring
>&
files
,
const
std
::
s
tring
&
remoteprefix
,
const
std
::
s
tring
&
url
);
bool
SubmitUsingHTTP
(
const
std
::
s
tring
&
localprefix
,
const
std
::
vector
<
std
::
s
tring
>&
files
,
const
std
::
s
tring
&
remoteprefix
,
const
std
::
s
tring
&
url
);
bool
SubmitUsingSCP
(
const
std
::
s
tring
&
localprefix
,
const
std
::
vector
<
std
::
s
tring
>&
files
,
const
std
::
s
tring
&
remoteprefix
,
const
std
::
s
tring
&
url
);
bool
SubmitUsingFTP
(
const
cmStdS
tring
&
localprefix
,
const
std
::
vector
<
cmStdS
tring
>&
files
,
const
cmStdS
tring
&
remoteprefix
,
const
cmStdS
tring
&
url
);
bool
SubmitUsingHTTP
(
const
cmStdS
tring
&
localprefix
,
const
std
::
vector
<
cmStdS
tring
>&
files
,
const
cmStdS
tring
&
remoteprefix
,
const
cmStdS
tring
&
url
);
bool
SubmitUsingSCP
(
const
cmStdS
tring
&
localprefix
,
const
std
::
vector
<
cmStdS
tring
>&
files
,
const
cmStdS
tring
&
remoteprefix
,
const
cmStdS
tring
&
url
);
bool
TriggerUsingHTTP
(
const
std
::
vector
<
std
::
s
tring
>&
files
,
const
std
::
s
tring
&
remoteprefix
,
const
std
::
s
tring
&
url
);
bool
TriggerUsingHTTP
(
const
std
::
vector
<
cmStdS
tring
>&
files
,
const
cmStdS
tring
&
remoteprefix
,
const
cmStdS
tring
&
url
);
private:
std
::
s
tring
m_HTTPProxy
;
cmStdS
tring
m_HTTPProxy
;
int
m_HTTPProxyType
;
std
::
s
tring
m_FTPProxy
;
cmStdS
tring
m_FTPProxy
;
int
m_FTPProxyType
;
bool
m_Verbose
;
};
...
...
Source/CursesDialog/cmCursesPathWidget.cxx
View file @
5b232ded
...
...
@@ -62,7 +62,7 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w)
{
glob
=
cstr
+
"*"
;
}
std
::
vector
<
std
::
s
tring
>
dirs
;
std
::
vector
<
cmStdS
tring
>
dirs
;
cmSystemTools
::
SimpleGlob
(
glob
.
c_str
(),
dirs
,
(
m_Type
==
cmCacheManager
::
PATH
?-
1
:
0
));
if
(
m_CurrentIndex
<
dirs
.
size
()
)
...
...
Source/cmCTest.cxx
View file @
5b232ded
This diff is collapsed.
Click to expand it.
Source/cmCTest.h
View file @
5b232ded
...
...
@@ -24,6 +24,8 @@
class
cmCTest
{
public:
typedef
std
::
vector
<
cmStdString
>
tm_VectorOfStrings
;
/**
* Run a dashboard using a specified confiuration script
*/
...
...
@@ -55,7 +57,7 @@ public:
/**
* Try to run tests of the project
*/
int
TestDirectory
();
int
TestDirectory
(
bool
memcheck
);
/**
* Try to get coverage of the project
...
...
@@ -86,8 +88,9 @@ public:
/**
* Run the test for a directory and any subdirectories
*/
void
ProcessDirectory
(
std
::
vector
<
std
::
string
>
&
passed
,
std
::
vector
<
std
::
string
>
&
failed
);
void
ProcessDirectory
(
tm_VectorOfStrings
&
passed
,
tm_VectorOfStrings
&
failed
,
bool
memcheck
);
/**
* Find the executable for a test
...
...
@@ -143,7 +146,7 @@ private:
BUILD_TEST
=
4
,
TEST_TEST
=
5
,
COVERAGE_TEST
=
6
,
PURIFY
_TEST
=
7
,
MEMCHECK
_TEST
=
7
,
SUBMIT_TEST
=
8
,
ALL_TEST
=
9
,
LAST_TEST
=
10
...
...
@@ -162,6 +165,40 @@ private:
COMPLETED
};
enum
{
// Memory checkers
UNKNOWN
=
0
,
VALGRIND
,
PURIFY
,
BOUNDS_CHECKER
};
enum
{
// Memory faults
ABR
=
0
,
ABW
,
ABWL
,
COR
,
EXU
,
FFM
,
FIM
,
FMM
,
FMR
,
FMW
,
FUM
,
IPR
,
IPW
,
MAF
,
MLK
,
MPK
,
NPR
,
ODS
,
PAR
,
PLK
,
UMC
,
UMR
,
NO_MEMORY_FAULT
};
struct
cmCTestTestResult
{
std
::
string
m_Name
;
...
...
@@ -235,10 +272,20 @@ private:
int
m_TimeOut
;
std
::
string
m_MemoryTester
;
std
::
string
m_MemoryTesterOptions
;
int
m_MemoryTesterStyle
;
std
::
string
m_MemoryTesterOutputFile
;
tm_VectorOfStrings
m_MemoryTesterOptionsParsed
;
int
m_MemoryTesterGlobalResults
[
NO_MEMORY_FAULT
];
int
m_CompatibilityMode
;
/**
* Generate the Dart compatible output
*/
void
GenerateDartTestOutput
(
std
::
ostream
&
os
);
void
GenerateDartMemCheckOutput
(
std
::
ostream
&
os
);
void
GenerateDartBuildOutput
(
std
::
ostream
&
os
,
std
::
vector
<
cmCTestBuildErrorWarning
>
);
...
...
@@ -259,6 +306,20 @@ private:
std
::
string
GenerateRegressionImages
(
const
std
::
string
&
xml
);
const
char
*
GetTestStatus
(
int
status
);
//! Start CTest XML output file
void
StartXML
(
ostream
&
ostr
);
//! End CTest XML output file
void
EndXML
(
ostream
&
ostr
);
//! Parse Valgrind/Purify/Bounds Checker result out of the output string. After running,
// log holds the output and results hold the different memmory errors.
bool
ProcessMemCheckOutput
(
const
std
::
string
&
str
,
std
::
string
&
log
,
int
*
results
);
bool
ProcessMemCheckValgrindOutput
(
const
std
::
string
&
str
,
std
::
string
&
log
,
int
*
results
);
//! Initialize memory checking subsystem.
bool
InitializeMemoryChecking
();
};
#endif
Source/cmSystemTools.cxx
View file @
5b232ded
...
...
@@ -909,8 +909,8 @@ void cmSystemTools::ExpandListArgument(const std::string& arg,
}
}
bool
cmSystemTools
::
SimpleGlob
(
const
std
::
s
tring
&
glob
,
std
::
vector
<
std
::
s
tring
>&
files
,
bool
cmSystemTools
::
SimpleGlob
(
const
cmStdS
tring
&
glob
,
std
::
vector
<
cmStdS
tring
>&
files
,
int
type
/* = 0 */
)
{
files
.
clear
();
...
...
Source/cmSystemTools.h
View file @
5b232ded
...
...
@@ -139,7 +139,7 @@ public:
* want to find. 0 means all files, -1 means directories, 1 means
* files only. This method returns true if search was succesfull.
*/
static
bool
SimpleGlob
(
const
std
::
s
tring
&
glob
,
std
::
vector
<
std
::
s
tring
>&
files
,
static
bool
SimpleGlob
(
const
cmStdS
tring
&
glob
,
std
::
vector
<
cmStdS
tring
>&
files
,
int
type
=
0
);
///! Copy a file.
...
...
Source/ctest.cxx
View file @
5b232ded
...
...
@@ -197,10 +197,10 @@ int main (int argc, char *argv[])
inst
.
SetTestModel
(
cmCTest
::
EXPERIMENTAL
);
inst
.
SetTest
(
"Test"
);
}
else
if
(
targ
==
"ExperimentalPurify"
)
else
if
(
targ
==
"ExperimentalMemCheck"
||
targ
==
"ExperimentalPurify"
)
{
inst
.
SetTestModel
(
cmCTest
::
EXPERIMENTAL
);
inst
.
SetTest
(
"
Purify
"
);
inst
.
SetTest
(
"
MemCheck
"
);
}
else
if
(
targ
==
"ExperimentalCoverage"
)
{
...
...
@@ -248,10 +248,10 @@ int main (int argc, char *argv[])
inst
.
SetTestModel
(
cmCTest
::
CONTINUOUS
);
inst
.
SetTest
(
"Test"
);
}
else
if
(
targ
==
"ContinuousPurify"
)
else
if
(
targ
==
"ContinuousMemCheck"
||
targ
==
"ContinuousPurify"
)
{
inst
.
SetTestModel
(
cmCTest
::
CONTINUOUS
);
inst
.
SetTest
(
"
Purify
"
);
inst
.
SetTest
(
"
MemCheck
"
);
}
else
if
(
targ
==
"ContinuousCoverage"
)
{
...
...
@@ -299,10 +299,10 @@ int main (int argc, char *argv[])
inst
.
SetTestModel
(
cmCTest
::
NIGHTLY
);
inst
.
SetTest
(
"Test"
);
}
else
if
(
targ
==
"NightlyPurify"
)
else
if
(
targ
==
"NightlyMemCheck"
||
targ
==
"NightlyPurify"
)
{
inst
.
SetTestModel
(
cmCTest
::
NIGHTLY
);
inst
.
SetTest
(
"
Purify
"
);
inst
.
SetTest
(
"
MemCheck
"
);
}
else
if
(
targ
==
"NightlyCoverage"
)
{
...
...
@@ -320,7 +320,7 @@ int main (int argc, char *argv[])
inst
.
SetTest
(
"Start"
);
inst
.
SetTest
(
"Configure"
);
inst
.
SetTest
(
"Build"
);
inst
.
SetTest
(
"
Purify
"
);
inst
.
SetTest
(
"
MemCheck
"
);
inst
.
SetTest
(
"Coverage"
);
inst
.
SetTest
(
"Submit"
);
}
...
...
@@ -331,7 +331,7 @@ int main (int argc, char *argv[])
inst
.
SetTest
(
"Update"
);
inst
.
SetTest
(
"Configure"
);
inst
.
SetTest
(
"Build"
);
inst
.
SetTest
(
"
Purify
"
);
inst
.
SetTest
(
"
MemCheck
"
);
inst
.
SetTest
(
"Coverage"
);
inst
.
SetTest
(
"Submit"
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment