summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2010-07-02 17:22:30 (GMT)
committerDavid Cole <david.cole@kitware.com>2010-07-10 19:04:31 (GMT)
commitb2634b6aa3a0203e3a97060cf9e3206245a85080 (patch)
tree18ef0434ff6e939217f81c6bd2eed39549e73b65 /Source/CTest
parent012c9863096612971f3b8d227a5b372be3281ca4 (diff)
downloadCMake-b2634b6aa3a0203e3a97060cf9e3206245a85080.zip
CMake-b2634b6aa3a0203e3a97060cf9e3206245a85080.tar.gz
CMake-b2634b6aa3a0203e3a97060cf9e3206245a85080.tar.bz2
Detect CMake warnings and errors in build output.
Fix niggly in ExternalProject that would inadvertently create a log file of output when a command was explicitly set to the empty string. Also, increase the default value for showing context around build errors to 10 lines, up from 6. Also add the ability to customize this setting so that users can put it back to 6 or even lower if they want, or show more if they want.
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx25
1 files changed, 20 insertions, 5 deletions
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index bc02fbc..619783f 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -65,7 +65,7 @@ static const char* cmCTestErrorMatches[] = {
"^Unresolved:",
"Undefined symbols:",
"^Undefined[ \\t]+first referenced",
- "^CMake Error:",
+ "^CMake Error.*:",
":[ \\t]cannot find",
":[ \\t]can't find",
": \\*\\*\\* No rule to make target \\`.*\\'. Stop",
@@ -129,6 +129,7 @@ static const char* cmCTestWarningMatches[] = {
"\\([0-9]*\\): remark #[0-9]*",
"\".*\", line [0-9]+: remark\\([0-9]*\\):",
"cc-[0-9]* CC: REMARK File = .*, Line = [0-9]*",
+ "^CMake Warning.*:",
0
};
@@ -174,8 +175,8 @@ cmCTestWarningErrorFileLine[] = {
//----------------------------------------------------------------------
cmCTestBuildHandler::cmCTestBuildHandler()
{
- this->MaxPreContext = 6;
- this->MaxPostContext = 6;
+ this->MaxPreContext = 10;
+ this->MaxPostContext = 10;
this->MaxErrors = 50;
this->MaxWarnings = 50;
@@ -214,8 +215,8 @@ void cmCTestBuildHandler::Initialize()
this->ErrorsAndWarnings.clear();
this->LastErrorOrWarning = this->ErrorsAndWarnings.end();
this->PostContextCount = 0;
- this->MaxPreContext = 6;
- this->MaxPostContext = 6;
+ this->MaxPreContext = 10;
+ this->MaxPostContext = 10;
this->PreContext.clear();
this->TotalErrors = 0;
@@ -249,6 +250,20 @@ void cmCTestBuildHandler::PopulateCustomVectors(cmMakefile *mf)
"CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS",
this->MaxWarnings);
+ int n = -1;
+ this->CTest->PopulateCustomInteger(mf, "CTEST_CUSTOM_ERROR_PRE_CONTEXT", n);
+ if (n != -1)
+ {
+ this->MaxPreContext = static_cast<size_t>(n);
+ }
+
+ n = -1;
+ this->CTest->PopulateCustomInteger(mf, "CTEST_CUSTOM_ERROR_POST_CONTEXT", n);
+ if (n != -1)
+ {
+ this->MaxPostContext = static_cast<size_t>(n);
+ }
+
// Record the user-specified custom warning rules.
if(const char* customWarningMatchers =
mf->GetDefinition("CTEST_CUSTOM_WARNING_MATCH"))