[Cmake-commits] CMake branch, next, updated. v3.2.0-rc2-715-gd81a19c

Zack Galbreath zack.galbreath at kitware.com
Tue Feb 24 16:19:44 EST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  d81a19c7edb2dffa9f4bdbdeadacc8cce16522b2 (commit)
       via  1e9d94195d8d2c5ef36f68314d3a7786235cc98a (commit)
       via  fde2c82eaaee2fe29f564b0ed5d95283aed5abf5 (commit)
       via  f8b1fc024135d61e8e5b01a914422db3c6a92333 (commit)
       via  ae98b7c754601dc524cede3f564cf17d5d076de0 (commit)
      from  1f09ba7030818eb51d5abd9f32e0ae3c873c43e2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d81a19c7edb2dffa9f4bdbdeadacc8cce16522b2
commit d81a19c7edb2dffa9f4bdbdeadacc8cce16522b2
Merge: 1f09ba7 1e9d941
Author:     Zack Galbreath <zack.galbreath at kitware.com>
AuthorDate: Tue Feb 24 16:19:43 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Feb 24 16:19:43 2015 -0500

    Merge topic 'revert_error_in_read_script' into next
    
    1e9d9419 Revert "Change how CTest errors are reported"
    fde2c82e Revert "new test case for ctest_build"
    f8b1fc02 new test case for ctest_build
    ae98b7c7 Change how CTest errors are reported


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1e9d94195d8d2c5ef36f68314d3a7786235cc98a
commit 1e9d94195d8d2c5ef36f68314d3a7786235cc98a
Author:     Zack Galbreath <zack.galbreath at kitware.com>
AuthorDate: Tue Feb 24 16:19:10 2015 -0500
Commit:     Zack Galbreath <zack.galbreath at kitware.com>
CommitDate: Tue Feb 24 16:19:10 2015 -0500

    Revert "Change how CTest errors are reported"
    
    This reverts commit 9759197a80a2e3b295e3c1ef6f420a8d135521b0.

diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index ea95401..790e488 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -183,7 +183,6 @@ bool cmCTestCoverageHandler::StartCoverageLogFile(
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open log file: "
       << covLogFilename << std::endl);
-    this->SetScriptErrorOccurred(true);
     return false;
     }
   std::string local_start_time = this->CTest->CurrentTime();
@@ -349,7 +348,6 @@ int cmCTestCoverageHandler::ProcessHandler()
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Cannot create LastCoverage.log file" << std::endl);
-    this->SetScriptErrorOccurred(true);
     }
 
   ofs << "Performing coverage: " << elapsed_time_start << std::endl;
@@ -458,7 +456,6 @@ int cmCTestCoverageHandler::ProcessHandler()
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Cannot open coverage summary file." << std::endl);
-    this->SetScriptErrorOccurred(true);
     return -1;
     }
 
@@ -526,7 +523,6 @@ int cmCTestCoverageHandler::ProcessHandler()
       {
       cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot find file: "
         << fullFileName << std::endl);
-      this->SetScriptErrorOccurred(true);
       continue;
       }
 
@@ -688,7 +684,6 @@ int cmCTestCoverageHandler::ProcessHandler()
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "  " << *erIt << std::endl);
       }
-    this->SetScriptErrorOccurred(true);
     }
 
   long total_lines = total_tested + total_untested;
@@ -1010,7 +1005,6 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Could not find gcov." << std::endl);
-    this->SetScriptErrorOccurred(true);
     return 0;
     }
   std::string gcovExtraFlags
@@ -1118,7 +1112,6 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "Command produced error: " << errors << std::endl);
       cont->Error ++;
-      this->SetScriptErrorOccurred(true);
       continue;
       }
     if ( retVal != 0 )
@@ -1127,7 +1120,6 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
         << retVal << " while processing: " << *it << std::endl);
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "Command produced error: " << cont->Error << std::endl);
-      this->SetScriptErrorOccurred(true);
       }
     cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
       "--------------------------------------------------------------"
@@ -1164,7 +1156,6 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e1"
             << std::endl);
           cont->Error ++;
-          this->SetScriptErrorOccurred(true);
           break;
           }
 
@@ -1182,7 +1173,6 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e2"
             << std::endl);
           cont->Error ++;
-          this->SetScriptErrorOccurred(true);
           break;
           }
 
@@ -1199,7 +1189,6 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e3"
             << std::endl);
           cont->Error ++;
-          this->SetScriptErrorOccurred(true);
           break;
           }
 
@@ -1217,7 +1206,6 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e4"
             << std::endl);
           cont->Error ++;
-          this->SetScriptErrorOccurred(true);
           break;
           }
         }
@@ -1232,7 +1220,6 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e5"
             << std::endl);
           cont->Error ++;
-          this->SetScriptErrorOccurred(true);
           break;
           }
 
@@ -1249,7 +1236,6 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e6"
             << std::endl);
           cont->Error ++;
-          this->SetScriptErrorOccurred(true);
           break;
           }
 
@@ -1267,7 +1253,6 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e7"
             << std::endl);
           cont->Error ++;
-          this->SetScriptErrorOccurred(true);
           break;
           }
 
@@ -1285,7 +1270,6 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e8"
             << std::endl);
           cont->Error ++;
-          this->SetScriptErrorOccurred(true);
           break;
           }
 
@@ -1303,7 +1287,6 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE,
             "Unknown gcov output line: [" << *line << "]"
             << std::endl);
-          this->SetScriptErrorOccurred(true);
           cont->Error ++;
           //abort();
           }
@@ -1327,7 +1310,6 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           {
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open file: "
             << gcovFile << std::endl);
-          this->SetScriptErrorOccurred(true);
           }
         else
           {
@@ -1544,7 +1526,6 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "Command produced error: " << errors << std::endl);
       cont->Error ++;
-      this->SetScriptErrorOccurred(true);
       continue;
       }
     if ( retVal != 0 )
@@ -1553,7 +1534,6 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
         << retVal << " while processing: " << *it << std::endl);
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "Command produced error: " << cont->Error << std::endl);
-      this->SetScriptErrorOccurred(true);
       }
     cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
       "--------------------------------------------------------------"
@@ -1604,7 +1584,6 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
           {
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open file: "
                      << lcovFile << std::endl);
-          this->SetScriptErrorOccurred(true);
           }
         std::string srcname;
 
@@ -1614,7 +1593,6 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE,
                      "Error while parsing lcov file '" << lcovFile << "':"
                      << " No source file name found!" << std::endl);
-          this->SetScriptErrorOccurred(true);
           return 0;
           }
         srcname = srcname.substr(18);
@@ -1648,7 +1626,6 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
             {
             cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open file: "
                        << lcovFile << std::endl);
-            this->SetScriptErrorOccurred(true);
             }
           else
             {
@@ -1824,7 +1801,6 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "Cannot find source Python file corresponding to: "
         << *fileIt << std::endl);
-      this->SetScriptErrorOccurred(true);
       continue;
       }
 
@@ -1842,7 +1818,6 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
       {
       cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open file: "
         << *fileIt << std::endl);
-      this->SetScriptErrorOccurred(true);
       }
     else
       {
@@ -1879,7 +1854,6 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
               cmCTestLog(this->CTest, ERROR_MESSAGE,
                 "Currently the limit is maximum coverage of 999999"
                 << std::endl);
-              this->SetScriptErrorOccurred(true);
               }
             }
           }
@@ -1974,7 +1948,6 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Files and full path files not the same size?:\n");
-    this->SetScriptErrorOccurred(true);
     return 0;
     }
   // create the output stream for the CoverageLog-N.xml file
@@ -1982,7 +1955,6 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
   int logFileCount = 0;
   if ( !this->StartCoverageLogFile(covLogFile, logFileCount) )
     {
-    this->SetScriptErrorOccurred(true);
     return -1;
     }
   // for each file run covbr on that file to get the coverage
@@ -1994,7 +1966,6 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
   if(!this->RunBullseyeCommand(cont, "covbr", 0, outputFile))
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "error running covbr for." << "\n");
-    this->SetScriptErrorOccurred(true);
     return -1;
     }
   cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
@@ -2006,7 +1977,6 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Cannot open coverage file: " <<
                outputFile << std::endl);
-    this->SetScriptErrorOccurred(true);
     return 0;
     }
   std::map<std::string, std::string> fileMap;
@@ -2119,7 +2089,6 @@ int cmCTestCoverageHandler::RunBullseyeCommand(
   if(program.empty())
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot find :" << cmd << "\n");
-    this->SetScriptErrorOccurred(true);
     return 0;
     }
   if(arg)
@@ -2151,7 +2120,6 @@ int cmCTestCoverageHandler::RunBullseyeCommand(
                << program << " " << arg << "\n"
                << "kwsys process state : "
                << runCoverageSrc.GetProcessState());
-    this->SetScriptErrorOccurred(true);
     return 0;
     }
   // since we set the output file names wait for it to end
@@ -2169,7 +2137,6 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
   if(!this->RunBullseyeCommand(cont, "covsrc", "-c", outputFile))
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "error running covsrc:\n");
-    this->SetScriptErrorOccurred(true);
     return 0;
     }
 
@@ -2180,7 +2147,6 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Cannot open coverage summary file." << std::endl);
-    this->SetScriptErrorOccurred(true);
     return 0;
     }
   this->CTest->StartXML(covSumFile, this->AppendXML);
@@ -2221,7 +2187,6 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Cannot open coverage summary file: " <<
                outputFile << std::endl);
-    this->SetScriptErrorOccurred(true);
     return 0;
     }
   std::set<std::string> coveredFileNames;
@@ -2386,7 +2351,6 @@ int cmCTestCoverageHandler::HandleBullseyeCoverage(
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Error running bullseye summary.\n");
-    this->SetScriptErrorOccurred(true);
     return 0;
     }
   cmCTestOptionalLog(this->CTest, DEBUG, "HandleBullseyeCoverage return 1 "
@@ -2425,7 +2389,6 @@ bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine(
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing string : "
                << inputLine << "\n");
-    this->SetScriptErrorOccurred(true);
     return false;
     }
   // the source file has "" around it so extract out the file name
@@ -2461,7 +2424,6 @@ bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine(
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing input : "
                << inputLine << " last pos not npos =  " << pos <<
                "\n");
-    this->SetScriptErrorOccurred(true);
     }
   return true;
 }
diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx
index c16ec2b..81eb0a8 100644
--- a/Source/CTest/cmCTestGenericHandler.cxx
+++ b/Source/CTest/cmCTestGenericHandler.cxx
@@ -23,7 +23,6 @@ cmCTestGenericHandler::cmCTestGenericHandler()
   this->SubmitIndex = 0;
   this->AppendXML = false;
   this->Quiet = false;
-  this->ScriptErrorOccurred = false;
 }
 
 //----------------------------------------------------------------------
diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h
index d83ad7b..8567dd7 100644
--- a/Source/CTest/cmCTestGenericHandler.h
+++ b/Source/CTest/cmCTestGenericHandler.h
@@ -90,12 +90,6 @@ public:
   void SetQuiet(bool b) { this->Quiet = b; }
   bool GetQuiet() { return this->Quiet; }
 
-  /**
-   * Get/Set whether or not a script-level error occurred.
-   */
-  bool GetScriptErrorOccurred() { return this->ScriptErrorOccurred; }
-  void SetScriptErrorOccurred(bool b) { this->ScriptErrorOccurred = b; }
-
 protected:
   bool StartResultingXML(cmCTest::Part part,
                          const char* name, cmGeneratedFileStream& xofs);
@@ -103,7 +97,6 @@ protected:
 
   bool AppendXML;
   bool Quiet;
-  bool ScriptErrorOccurred;
   cmSystemTools::OutputOption HandlerVerbose;
   cmCTest *CTest;
   t_StringToString Options;
diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx
index 571e539..3003e8a 100644
--- a/Source/CTest/cmCTestHandlerCommand.cxx
+++ b/Source/CTest/cmCTestHandlerCommand.cxx
@@ -141,12 +141,6 @@ bool cmCTestHandlerCommand
   cmSystemTools::ChangeDirectory(
     this->CTest->GetCTestConfiguration("BuildDirectory"));
   int res = handler->ProcessHandler();
-  cmSystemTools::ChangeDirectory(current_dir);
-
-  if (handler->GetScriptErrorOccurred())
-    {
-    return false;
-    }
   if ( this->Values[ct_RETURN_VALUE] && *this->Values[ct_RETURN_VALUE])
     {
     std::ostringstream str;
@@ -154,6 +148,7 @@ bool cmCTestHandlerCommand
     this->Makefile->AddDefinition(
       this->Values[ct_RETURN_VALUE], str.str().c_str());
     }
+  cmSystemTools::ChangeDirectory(current_dir);
   return true;
 }
 
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index f603297..061f3fd 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -51,7 +51,6 @@ static void xmlReportError(int line, const char* msg, void* data)
   cmCTestLog(ctest, ERROR_MESSAGE,
              "Error parsing XML in stream at line "
              << line << ": " << msg << std::endl);
-  ctest->GetHandler("memcheck")->SetScriptErrorOccurred(true);
 }
 
 // parse the xml file containing the results of last BoundsChecker run
@@ -112,7 +111,6 @@ public:
         this->Errors.push_back(cmCTestMemCheckHandler::ABW); // do not know
         cmCTestLog(this->CTest, ERROR_MESSAGE,
                    "No Category found in Bounds checker XML\n" );
-        this->CTest->GetHandler("memcheck")->SetScriptErrorOccurred(true);
         return;
         }
       while(ptr->ErrorCategory && cat)
@@ -130,7 +128,6 @@ public:
         cmCTestLog(this->CTest, ERROR_MESSAGE,
                    "Found unknown Bounds Checker error "
                    << ptr->ErrorCategory << std::endl);
-        this->CTest->GetHandler("memcheck")->SetScriptErrorOccurred(true);
         }
     }
   cmCTest* CTest;
@@ -178,7 +175,6 @@ int cmCTestMemCheckHandler::PreProcessHandler()
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Problem executing pre-memcheck command(s)." << std::endl);
-    this->SetScriptErrorOccurred(true);
     return 0;
     }
   return 1;
@@ -191,7 +187,6 @@ int cmCTestMemCheckHandler::PostProcessHandler()
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Problem executing post-memcheck command(s)." << std::endl);
-    this->SetScriptErrorOccurred(true);
     return 0;
     }
   return 1;
@@ -651,7 +646,6 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
             "Cannot find memory checker suppression file: "
             << this->CTest->GetCTestConfiguration(
               "MemoryCheckSuppressionFile") << std::endl);
-          this->SetScriptErrorOccurred(true);
           return false;
           }
         std::string suppressions = "--suppressions="
@@ -677,7 +671,6 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
                      "Cannot find memory checker suppression file: "
                      << this->CTest->GetCTestConfiguration(
                        "MemoryCheckSuppressionFile").c_str() << std::endl);
-          this->SetScriptErrorOccurred(true);
           return false;
           }
         std::string filterFiles = "/FilterFiles="
@@ -749,7 +742,6 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "Do not understand memory checker: " << this->MemoryTester
         << std::endl);
-      this->SetScriptErrorOccurred(true);
       return false;
     }
 
@@ -916,7 +908,6 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
           << pfW.match(1) << std::endl);
         ostr << "*** Unknown Purify memory fault: " << pfW.match(1)
           << std::endl;
-        this->SetScriptErrorOccurred(true);
         }
       }
     if ( failure != this->ResultStrings.size() )
@@ -1152,7 +1143,6 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput(
         cmCTestLog(this->CTest, ERROR_MESSAGE,
                    "Error in ParseChunk: " << theLine
                    << std::endl);
-        this->SetScriptErrorOccurred(true);
         }
       }
     }
@@ -1227,7 +1217,6 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res,
     {
     std::string log = "Cannot read memory tester output file: " + ofile;
     cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl);
-    this->SetScriptErrorOccurred(true);
     return;
     }
   res.Output += BOUNDS_CHECKER_MARKER;
@@ -1263,7 +1252,6 @@ cmCTestMemCheckHandler::AppendMemTesterOutput(cmCTestTestResult& res,
     {
     std::string log = "Cannot read memory tester output file: " + ofile;
     cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl);
-    this->SetScriptErrorOccurred(true);
     return;
     }
   std::string line;
@@ -1302,7 +1290,6 @@ void cmCTestMemCheckHandler::TestOutputFileNames(int test,
       std::string log = "Cannot find memory tester output file: "
         + ofile;
       cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl);
-      this->SetScriptErrorOccurred(true);
       ofile = "";
       }
     else
@@ -1316,7 +1303,6 @@ void cmCTestMemCheckHandler::TestOutputFileNames(int test,
     std::string log = "Cannot find memory tester output file: "
       + ofile;
     cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl);
-    this->SetScriptErrorOccurred(true);
     ofile = "";
     }
   files.push_back(ofile);
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index ddb5f4c..d585863 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -235,7 +235,6 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
           << local_file << std::endl);
         ::curl_easy_cleanup(curl);
         ::curl_global_cleanup();
-        this->SetScriptErrorOccurred(true);
         return false;
         }
       unsigned long filelen = cmSystemTools::FileLength(local_file);
@@ -315,7 +314,6 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
         *this->LogFile << std::endl;
         ::curl_easy_cleanup(curl);
         ::curl_global_cleanup();
-        this->SetScriptErrorOccurred(true);
         return false;
         }
       // always cleanup
@@ -479,7 +477,6 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
           << local_file << std::endl);
         ::curl_easy_cleanup(curl);
         ::curl_global_cleanup();
-        this->SetScriptErrorOccurred(true);
         return false;
         }
       unsigned long filelen = cmSystemTools::FileLength(local_file);
@@ -624,7 +621,6 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
           }
         ::curl_easy_cleanup(curl);
         ::curl_global_cleanup();
-        this->SetScriptErrorOccurred(true);
         return false;
         }
       // always cleanup
@@ -787,7 +783,6 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
           }
         ::curl_easy_cleanup(curl);
         ::curl_global_cleanup();
-        this->SetScriptErrorOccurred(true);
         return false;
         }
 
@@ -913,7 +908,6 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(
   cmsysProcess_Delete(cp);
   if ( problems )
     {
-    this->SetScriptErrorOccurred(true);
     return false;
     }
   return true;
@@ -935,7 +929,6 @@ bool cmCTestSubmitHandler::SubmitUsingCP(
                << "\tNumber of files: " << files.size() << "\n"
                << "\tremoteprefix: " << remoteprefix << "\n"
                << "\tdestination: " << destination << std::endl);
-    this->SetScriptErrorOccurred(true);
     return 0;
     }
 
@@ -1003,7 +996,6 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
       {
       cmCTestLog(this->CTest, ERROR_MESSAGE, "  Cannot find file: "
         << local_file.c_str() << std::endl);
-      this->SetScriptErrorOccurred(true);
       return false;
       }
 
@@ -1014,7 +1006,6 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
       {
       cmCTestLog(this->CTest, ERROR_MESSAGE, "  File too big: "
         << local_file.c_str() << std::endl);
-      this->SetScriptErrorOccurred(true);
       return false;
       }
     size_t fileSize = static_cast<size_t>(st.st_size);
@@ -1023,7 +1014,6 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
       {
       cmCTestLog(this->CTest, ERROR_MESSAGE, "  Cannot open file: "
         << local_file.c_str() << std::endl);
-      this->SetScriptErrorOccurred(true);
       return false;
       }
 
@@ -1034,7 +1024,6 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
       fclose(fp);
       cmCTestLog(this->CTest, ERROR_MESSAGE, "  Cannot read file: "
         << local_file.c_str() << std::endl);
-      this->SetScriptErrorOccurred(true);
       return false;
       }
     fclose(fp);
@@ -1052,7 +1041,6 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
         << env.fault_string << " (" << env.fault_code << ")" << std::endl);
       xmlrpc_env_clean(&env);
       xmlrpc_client_cleanup();
-      this->SetScriptErrorOccurred(true);
       return false;
       }
 
@@ -1109,14 +1097,12 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Upload file not specified\n");
-    this->SetScriptErrorOccurred(true);
     return -1;
     }
   if (!cmSystemTools::FileExists(file))
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Upload file not found: '" << file << "'\n");
-    this->SetScriptErrorOccurred(true);
     return -1;
     }
   cmCTestCurl curl(this->CTest);
@@ -1134,7 +1120,6 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Only http and https are supported for CDASH_UPLOAD\n");
-    this->SetScriptErrorOccurred(true);
     return -1;
     }
   char md5sum[33];
@@ -1177,7 +1162,6 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Error in HttpRequest\n" << response);
-    this->SetScriptErrorOccurred(true);
     return -1;
     }
   cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
@@ -1189,7 +1173,6 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "error parsing json string [" << response << "]\n"
                << reader.getFormattedErrorMessages() << "\n");
-    this->SetScriptErrorOccurred(true);
     return -1;
     }
   if(json["status"].asInt() != 0)
@@ -1197,7 +1180,6 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Bad status returned from CDash: "
                << json["status"].asInt());
-    this->SetScriptErrorOccurred(true);
     return -1;
     }
   if(json["datafilesmd5"].isArray())
@@ -1216,7 +1198,6 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "bad datafilesmd5 value in response "
                << response << "\n");
-    this->SetScriptErrorOccurred(true);
     return -1;
     }
 
@@ -1231,7 +1212,6 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "error uploading to CDash. "
                << file << " " << url << " " << fstr.str());
-    this->SetScriptErrorOccurred(true);
     return -1;
     }
   if(!reader.parse(response, json))
@@ -1239,7 +1219,6 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "error parsing json string [" << response << "]\n"
                << reader.getFormattedErrorMessages() << "\n");
-    this->SetScriptErrorOccurred(true);
     return -1;
     }
   cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
@@ -1270,7 +1249,6 @@ int cmCTestSubmitHandler::ProcessHandler()
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Cannot find BuildDirectory  key in the DartConfiguration.tcl"
       << std::endl);
-    this->SetScriptErrorOccurred(true);
     return -1;
     }
 
@@ -1479,7 +1457,6 @@ int cmCTestSubmitHandler::ProcessHandler()
         "   Problems when submitting via FTP"
         << std::endl);
       ofs << "   Problems when submitting via FTP" << std::endl;
-      this->SetScriptErrorOccurred(true);
       return -1;
       }
     if(!this->CDash)
@@ -1497,7 +1474,6 @@ int cmCTestSubmitHandler::ProcessHandler()
         cmCTestLog(this->CTest, ERROR_MESSAGE,
                    "   Problems when triggering via HTTP" << std::endl);
         ofs << "   Problems when triggering via HTTP" << std::endl;
-        this->SetScriptErrorOccurred(true);
         return -1;
         }
       cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
@@ -1541,7 +1517,6 @@ int cmCTestSubmitHandler::ProcessHandler()
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "   Problems when submitting via HTTP" << std::endl);
       ofs << "   Problems when submitting via HTTP" << std::endl;
-      this->SetScriptErrorOccurred(true);
       return -1;
       }
     if(!this->CDash)
@@ -1557,7 +1532,6 @@ int cmCTestSubmitHandler::ProcessHandler()
         cmCTestLog(this->CTest, ERROR_MESSAGE,
                    "   Problems when triggering via HTTP" << std::endl);
         ofs << "   Problems when triggering via HTTP" << std::endl;
-        this->SetScriptErrorOccurred(true);
         return -1;
         }
       }
@@ -1593,7 +1567,6 @@ int cmCTestSubmitHandler::ProcessHandler()
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "   Problems when submitting via XML-RPC" << std::endl);
       ofs << "   Problems when submitting via XML-RPC" << std::endl;
-      this->SetScriptErrorOccurred(true);
       return -1;
       }
     cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "   Submission successful"
@@ -1604,7 +1577,6 @@ int cmCTestSubmitHandler::ProcessHandler()
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "   Submission method \"xmlrpc\" not compiled into CTest!"
                << std::endl);
-    this->SetScriptErrorOccurred(true);
     return -1;
 #endif
     }
@@ -1633,7 +1605,6 @@ int cmCTestSubmitHandler::ProcessHandler()
         "   Problems when submitting via SCP"
         << std::endl);
       ofs << "   Problems when submitting via SCP" << std::endl;
-      this->SetScriptErrorOccurred(true);
       return -1;
       }
     cmSystemTools::ChangeDirectory(oldWorkingDirectory);
@@ -1667,7 +1638,6 @@ int cmCTestSubmitHandler::ProcessHandler()
         "   Problems when submitting via CP"
         << std::endl);
       ofs << "   Problems when submitting via cp" << std::endl;
-      this->SetScriptErrorOccurred(true);
       return -1;
       }
     cmSystemTools::ChangeDirectory(oldWorkingDirectory);
@@ -1679,7 +1649,6 @@ int cmCTestSubmitHandler::ProcessHandler()
 
   cmCTestLog(this->CTest, ERROR_MESSAGE, "   Unknown submission method: \""
     << dropMethod << "\"" << std::endl);
-  this->SetScriptErrorOccurred(true);
   return -1;
 }
 
diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx
index 57e9216..b18786a 100644
--- a/Source/CTest/cmCTestUpdateHandler.cxx
+++ b/Source/CTest/cmCTestUpdateHandler.cxx
@@ -204,7 +204,6 @@ int cmCTestUpdateHandler::ProcessHandler()
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Cannot find SourceDirectory  key in the DartConfiguration.tcl"
       << std::endl);
-    this->SetScriptErrorOccurred(true);
     return -1;
     }
 
@@ -254,7 +253,6 @@ int cmCTestUpdateHandler::ProcessHandler()
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open log file"
       << std::endl);
-    this->SetScriptErrorOccurred(true);
     return -1;
     }
   std::string start_time = this->CTest->CurrentTime();
@@ -320,14 +318,12 @@ int cmCTestUpdateHandler::ProcessHandler()
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "   There are modified or conflicting files in the repository"
       << std::endl);
-    this->SetScriptErrorOccurred(true);
     }
   if(!updated)
     {
     os << "Update command failed:\n" << vc->GetUpdateCommandLine();
     cmCTestLog(this->CTest, ERROR_MESSAGE, "   Update command failed: "
                << vc->GetUpdateCommandLine() << "\n");
-    this->SetScriptErrorOccurred(true);
     }
   os << "</UpdateReturnStatus>" << std::endl;
   os << "</Update>" << std::endl;
@@ -428,7 +424,6 @@ bool cmCTestUpdateHandler::SelectVCS()
         }
       e << " configuration key.";
       cmCTestLog(this->CTest, ERROR_MESSAGE, e.str() << std::endl);
-      this->SetScriptErrorOccurred(true);
       return false;
       }
     }
diff --git a/Source/CTest/cmCTestUploadHandler.cxx b/Source/CTest/cmCTestUploadHandler.cxx
index 965f88e..579190a 100644
--- a/Source/CTest/cmCTestUploadHandler.cxx
+++ b/Source/CTest/cmCTestUploadHandler.cxx
@@ -42,7 +42,6 @@ int cmCTestUploadHandler::ProcessHandler()
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Cannot open Upload.xml file" << std::endl);
-    this->SetScriptErrorOccurred(true);
     return -1;
     }
   std::string buildname = cmCTest::SafeBuildIdField(
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index aec943e..e6d3960 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -3122,6 +3122,7 @@ void cmCTest::Log(int logType, const char* file, int line, const char* msg,
       cmCTestLogOutputFileLine(err);
       err << msg;
       err.flush();
+      cmSystemTools::SetErrorOccured();
       break;
     default:
       cmCTestLogOutputFileLine(out);
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index f989aff..ccfe2b1 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -382,21 +382,8 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
         {
         if(!status.GetNestedError())
           {
-          if (cmSystemTools::GetFilenameName(
-              this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE")) ==
-              this->GetSafeDefinition("CTEST_SCRIPT_NAME") &&
-              std::string(pcmd->GetError()).find("unknown error") !=
-              std::string::npos)
-            {
-            // Don't report "unknown error" from a CTest script.
-            // Instead simply note that an error occurred.
-            cmSystemTools::SetFatalErrorOccured();
-            }
-          else
-            {
-            // The command invocation requested that we report an error.
-            this->IssueMessage(cmake::FATAL_ERROR, pcmd->GetError());
-            }
+          // The command invocation requested that we report an error.
+          this->IssueMessage(cmake::FATAL_ERROR, pcmd->GetError());
           }
         result = false;
         if ( this->GetCMakeInstance()->GetWorkingMode() != cmake::NORMAL_MODE)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fde2c82eaaee2fe29f564b0ed5d95283aed5abf5
commit fde2c82eaaee2fe29f564b0ed5d95283aed5abf5
Author:     Zack Galbreath <zack.galbreath at kitware.com>
AuthorDate: Tue Feb 24 16:18:59 2015 -0500
Commit:     Zack Galbreath <zack.galbreath at kitware.com>
CommitDate: Tue Feb 24 16:18:59 2015 -0500

    Revert "new test case for ctest_build"
    
    This reverts commit 817262dff24bc37af224254152900858f8f62494.

diff --git a/Tests/RunCMake/ctest_build/BuildCompileError-stderr.txt b/Tests/RunCMake/ctest_build/BuildCompileError-stderr.txt
deleted file mode 100644
index d8e63fa..0000000
--- a/Tests/RunCMake/ctest_build/BuildCompileError-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-Error\(s\) when building project$
diff --git a/Tests/RunCMake/ctest_build/BuildCompileError-stdout.txt b/Tests/RunCMake/ctest_build/BuildCompileError-stdout.txt
deleted file mode 100644
index 63215c0..0000000
--- a/Tests/RunCMake/ctest_build/BuildCompileError-stdout.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-Run dashboard with model Experimental
-   Source directory: .*/Tests/RunCMake/ctest_build/BuildCompileError
-   Build directory: .*/Tests/RunCMake/ctest_build/BuildCompileError-build
-   Reading ctest configuration file: .*/Tests/RunCMake/ctest_build/BuildCompileError/CTestConfig.cmake
-   Site: test-site
-   Build name: test-build-name
-   Use Experimental tag: [0-9-]+
-Configure project
-   Each . represents 1024 bytes of output
-    . Size of output: [0-9]+K
-Build project
-   Each symbol represents 1024 bytes of output.
-   '!' represents an error and '\*' a warning.
-    . Size of output: [0-9]+K
-   [1-9] Compiler errors
-   0 Compiler warnings
diff --git a/Tests/RunCMake/ctest_build/CMakeLists.txt.in b/Tests/RunCMake/ctest_build/CMakeLists.txt.in
index 55ccc19..9ba08e9 100644
--- a/Tests/RunCMake/ctest_build/CMakeLists.txt.in
+++ b/Tests/RunCMake/ctest_build/CMakeLists.txt.in
@@ -1,6 +1,4 @@
 cmake_minimum_required(VERSION 3.1)
-project(CTestBuild at CASE_NAME@)
+project(CTestBuild at CASE_NAME@ NONE)
 include(CTest)
 add_test(NAME RunCMakeVersion COMMAND "${CMAKE_COMMAND}" --version)
-add_executable(compile_error EXCLUDE_FROM_ALL
-  @RunCMake_SOURCE_DIR@/../../CTestTestFailure/badCode.cxx)
diff --git a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
index 2fc80d3..5826fe4 100644
--- a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
@@ -8,4 +8,3 @@ function(run_ctest_build CASE_NAME)
 endfunction()
 
 run_ctest_build(BuildQuiet QUIET)
-run_ctest_build(BuildCompileError TARGET compile_error)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f8b1fc024135d61e8e5b01a914422db3c6a92333
commit f8b1fc024135d61e8e5b01a914422db3c6a92333
Author:     Zack Galbreath <zack.galbreath at kitware.com>
AuthorDate: Tue Feb 24 14:09:40 2015 -0500
Commit:     Zack Galbreath <zack.galbreath at kitware.com>
CommitDate: Tue Feb 24 16:18:45 2015 -0500

    new test case for ctest_build
    
    This demonstrates that "Error in read script" is not printed when
    compilation errors are encountered during a call to ctest_build().

diff --git a/Tests/RunCMake/ctest_build/BuildCompileError-stderr.txt b/Tests/RunCMake/ctest_build/BuildCompileError-stderr.txt
new file mode 100644
index 0000000..d8e63fa
--- /dev/null
+++ b/Tests/RunCMake/ctest_build/BuildCompileError-stderr.txt
@@ -0,0 +1 @@
+Error\(s\) when building project$
diff --git a/Tests/RunCMake/ctest_build/BuildCompileError-stdout.txt b/Tests/RunCMake/ctest_build/BuildCompileError-stdout.txt
new file mode 100644
index 0000000..63215c0
--- /dev/null
+++ b/Tests/RunCMake/ctest_build/BuildCompileError-stdout.txt
@@ -0,0 +1,16 @@
+Run dashboard with model Experimental
+   Source directory: .*/Tests/RunCMake/ctest_build/BuildCompileError
+   Build directory: .*/Tests/RunCMake/ctest_build/BuildCompileError-build
+   Reading ctest configuration file: .*/Tests/RunCMake/ctest_build/BuildCompileError/CTestConfig.cmake
+   Site: test-site
+   Build name: test-build-name
+   Use Experimental tag: [0-9-]+
+Configure project
+   Each . represents 1024 bytes of output
+    . Size of output: [0-9]+K
+Build project
+   Each symbol represents 1024 bytes of output.
+   '!' represents an error and '\*' a warning.
+    . Size of output: [0-9]+K
+   [1-9] Compiler errors
+   0 Compiler warnings
diff --git a/Tests/RunCMake/ctest_build/CMakeLists.txt.in b/Tests/RunCMake/ctest_build/CMakeLists.txt.in
index 9ba08e9..55ccc19 100644
--- a/Tests/RunCMake/ctest_build/CMakeLists.txt.in
+++ b/Tests/RunCMake/ctest_build/CMakeLists.txt.in
@@ -1,4 +1,6 @@
 cmake_minimum_required(VERSION 3.1)
-project(CTestBuild at CASE_NAME@ NONE)
+project(CTestBuild at CASE_NAME@)
 include(CTest)
 add_test(NAME RunCMakeVersion COMMAND "${CMAKE_COMMAND}" --version)
+add_executable(compile_error EXCLUDE_FROM_ALL
+  @RunCMake_SOURCE_DIR@/../../CTestTestFailure/badCode.cxx)
diff --git a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
index 5826fe4..2fc80d3 100644
--- a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
@@ -8,3 +8,4 @@ function(run_ctest_build CASE_NAME)
 endfunction()
 
 run_ctest_build(BuildQuiet QUIET)
+run_ctest_build(BuildCompileError TARGET compile_error)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ae98b7c754601dc524cede3f564cf17d5d076de0
commit ae98b7c754601dc524cede3f564cf17d5d076de0
Author:     Zack Galbreath <zack.galbreath at kitware.com>
AuthorDate: Mon Feb 23 15:04:01 2015 -0500
Commit:     Zack Galbreath <zack.galbreath at kitware.com>
CommitDate: Tue Feb 24 16:18:40 2015 -0500

    Change how CTest errors are reported
    
    "Error in read script" should only be displayed for issues
    that the site maintainer is expected to fix.  This message
    should not be displayed for more mundane problems like
    compilation errors & test failures.
    
    We distinguish between these two types of errors with the
    use of the following new function:
    cmCTestGenericHandler::SetScriptErrorOccurred(bool).

diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 790e488..ea95401 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -183,6 +183,7 @@ bool cmCTestCoverageHandler::StartCoverageLogFile(
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open log file: "
       << covLogFilename << std::endl);
+    this->SetScriptErrorOccurred(true);
     return false;
     }
   std::string local_start_time = this->CTest->CurrentTime();
@@ -348,6 +349,7 @@ int cmCTestCoverageHandler::ProcessHandler()
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Cannot create LastCoverage.log file" << std::endl);
+    this->SetScriptErrorOccurred(true);
     }
 
   ofs << "Performing coverage: " << elapsed_time_start << std::endl;
@@ -456,6 +458,7 @@ int cmCTestCoverageHandler::ProcessHandler()
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Cannot open coverage summary file." << std::endl);
+    this->SetScriptErrorOccurred(true);
     return -1;
     }
 
@@ -523,6 +526,7 @@ int cmCTestCoverageHandler::ProcessHandler()
       {
       cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot find file: "
         << fullFileName << std::endl);
+      this->SetScriptErrorOccurred(true);
       continue;
       }
 
@@ -684,6 +688,7 @@ int cmCTestCoverageHandler::ProcessHandler()
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "  " << *erIt << std::endl);
       }
+    this->SetScriptErrorOccurred(true);
     }
 
   long total_lines = total_tested + total_untested;
@@ -1005,6 +1010,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Could not find gcov." << std::endl);
+    this->SetScriptErrorOccurred(true);
     return 0;
     }
   std::string gcovExtraFlags
@@ -1112,6 +1118,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "Command produced error: " << errors << std::endl);
       cont->Error ++;
+      this->SetScriptErrorOccurred(true);
       continue;
       }
     if ( retVal != 0 )
@@ -1120,6 +1127,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
         << retVal << " while processing: " << *it << std::endl);
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "Command produced error: " << cont->Error << std::endl);
+      this->SetScriptErrorOccurred(true);
       }
     cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
       "--------------------------------------------------------------"
@@ -1156,6 +1164,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e1"
             << std::endl);
           cont->Error ++;
+          this->SetScriptErrorOccurred(true);
           break;
           }
 
@@ -1173,6 +1182,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e2"
             << std::endl);
           cont->Error ++;
+          this->SetScriptErrorOccurred(true);
           break;
           }
 
@@ -1189,6 +1199,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e3"
             << std::endl);
           cont->Error ++;
+          this->SetScriptErrorOccurred(true);
           break;
           }
 
@@ -1206,6 +1217,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e4"
             << std::endl);
           cont->Error ++;
+          this->SetScriptErrorOccurred(true);
           break;
           }
         }
@@ -1220,6 +1232,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e5"
             << std::endl);
           cont->Error ++;
+          this->SetScriptErrorOccurred(true);
           break;
           }
 
@@ -1236,6 +1249,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e6"
             << std::endl);
           cont->Error ++;
+          this->SetScriptErrorOccurred(true);
           break;
           }
 
@@ -1253,6 +1267,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e7"
             << std::endl);
           cont->Error ++;
+          this->SetScriptErrorOccurred(true);
           break;
           }
 
@@ -1270,6 +1285,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Unknown gcov output style e8"
             << std::endl);
           cont->Error ++;
+          this->SetScriptErrorOccurred(true);
           break;
           }
 
@@ -1287,6 +1303,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE,
             "Unknown gcov output line: [" << *line << "]"
             << std::endl);
+          this->SetScriptErrorOccurred(true);
           cont->Error ++;
           //abort();
           }
@@ -1310,6 +1327,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
           {
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open file: "
             << gcovFile << std::endl);
+          this->SetScriptErrorOccurred(true);
           }
         else
           {
@@ -1526,6 +1544,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "Command produced error: " << errors << std::endl);
       cont->Error ++;
+      this->SetScriptErrorOccurred(true);
       continue;
       }
     if ( retVal != 0 )
@@ -1534,6 +1553,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
         << retVal << " while processing: " << *it << std::endl);
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "Command produced error: " << cont->Error << std::endl);
+      this->SetScriptErrorOccurred(true);
       }
     cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
       "--------------------------------------------------------------"
@@ -1584,6 +1604,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
           {
           cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open file: "
                      << lcovFile << std::endl);
+          this->SetScriptErrorOccurred(true);
           }
         std::string srcname;
 
@@ -1593,6 +1614,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
           cmCTestLog(this->CTest, ERROR_MESSAGE,
                      "Error while parsing lcov file '" << lcovFile << "':"
                      << " No source file name found!" << std::endl);
+          this->SetScriptErrorOccurred(true);
           return 0;
           }
         srcname = srcname.substr(18);
@@ -1626,6 +1648,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
             {
             cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open file: "
                        << lcovFile << std::endl);
+            this->SetScriptErrorOccurred(true);
             }
           else
             {
@@ -1801,6 +1824,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "Cannot find source Python file corresponding to: "
         << *fileIt << std::endl);
+      this->SetScriptErrorOccurred(true);
       continue;
       }
 
@@ -1818,6 +1842,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
       {
       cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open file: "
         << *fileIt << std::endl);
+      this->SetScriptErrorOccurred(true);
       }
     else
       {
@@ -1854,6 +1879,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
               cmCTestLog(this->CTest, ERROR_MESSAGE,
                 "Currently the limit is maximum coverage of 999999"
                 << std::endl);
+              this->SetScriptErrorOccurred(true);
               }
             }
           }
@@ -1948,6 +1974,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Files and full path files not the same size?:\n");
+    this->SetScriptErrorOccurred(true);
     return 0;
     }
   // create the output stream for the CoverageLog-N.xml file
@@ -1955,6 +1982,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
   int logFileCount = 0;
   if ( !this->StartCoverageLogFile(covLogFile, logFileCount) )
     {
+    this->SetScriptErrorOccurred(true);
     return -1;
     }
   // for each file run covbr on that file to get the coverage
@@ -1966,6 +1994,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
   if(!this->RunBullseyeCommand(cont, "covbr", 0, outputFile))
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "error running covbr for." << "\n");
+    this->SetScriptErrorOccurred(true);
     return -1;
     }
   cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
@@ -1977,6 +2006,7 @@ int cmCTestCoverageHandler::RunBullseyeCoverageBranch(
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Cannot open coverage file: " <<
                outputFile << std::endl);
+    this->SetScriptErrorOccurred(true);
     return 0;
     }
   std::map<std::string, std::string> fileMap;
@@ -2089,6 +2119,7 @@ int cmCTestCoverageHandler::RunBullseyeCommand(
   if(program.empty())
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot find :" << cmd << "\n");
+    this->SetScriptErrorOccurred(true);
     return 0;
     }
   if(arg)
@@ -2120,6 +2151,7 @@ int cmCTestCoverageHandler::RunBullseyeCommand(
                << program << " " << arg << "\n"
                << "kwsys process state : "
                << runCoverageSrc.GetProcessState());
+    this->SetScriptErrorOccurred(true);
     return 0;
     }
   // since we set the output file names wait for it to end
@@ -2137,6 +2169,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
   if(!this->RunBullseyeCommand(cont, "covsrc", "-c", outputFile))
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "error running covsrc:\n");
+    this->SetScriptErrorOccurred(true);
     return 0;
     }
 
@@ -2147,6 +2180,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Cannot open coverage summary file." << std::endl);
+    this->SetScriptErrorOccurred(true);
     return 0;
     }
   this->CTest->StartXML(covSumFile, this->AppendXML);
@@ -2187,6 +2221,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Cannot open coverage summary file: " <<
                outputFile << std::endl);
+    this->SetScriptErrorOccurred(true);
     return 0;
     }
   std::set<std::string> coveredFileNames;
@@ -2351,6 +2386,7 @@ int cmCTestCoverageHandler::HandleBullseyeCoverage(
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Error running bullseye summary.\n");
+    this->SetScriptErrorOccurred(true);
     return 0;
     }
   cmCTestOptionalLog(this->CTest, DEBUG, "HandleBullseyeCoverage return 1 "
@@ -2389,6 +2425,7 @@ bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine(
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing string : "
                << inputLine << "\n");
+    this->SetScriptErrorOccurred(true);
     return false;
     }
   // the source file has "" around it so extract out the file name
@@ -2424,6 +2461,7 @@ bool cmCTestCoverageHandler::ParseBullsEyeCovsrcLine(
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Error parsing input : "
                << inputLine << " last pos not npos =  " << pos <<
                "\n");
+    this->SetScriptErrorOccurred(true);
     }
   return true;
 }
diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx
index 81eb0a8..c16ec2b 100644
--- a/Source/CTest/cmCTestGenericHandler.cxx
+++ b/Source/CTest/cmCTestGenericHandler.cxx
@@ -23,6 +23,7 @@ cmCTestGenericHandler::cmCTestGenericHandler()
   this->SubmitIndex = 0;
   this->AppendXML = false;
   this->Quiet = false;
+  this->ScriptErrorOccurred = false;
 }
 
 //----------------------------------------------------------------------
diff --git a/Source/CTest/cmCTestGenericHandler.h b/Source/CTest/cmCTestGenericHandler.h
index 8567dd7..d83ad7b 100644
--- a/Source/CTest/cmCTestGenericHandler.h
+++ b/Source/CTest/cmCTestGenericHandler.h
@@ -90,6 +90,12 @@ public:
   void SetQuiet(bool b) { this->Quiet = b; }
   bool GetQuiet() { return this->Quiet; }
 
+  /**
+   * Get/Set whether or not a script-level error occurred.
+   */
+  bool GetScriptErrorOccurred() { return this->ScriptErrorOccurred; }
+  void SetScriptErrorOccurred(bool b) { this->ScriptErrorOccurred = b; }
+
 protected:
   bool StartResultingXML(cmCTest::Part part,
                          const char* name, cmGeneratedFileStream& xofs);
@@ -97,6 +103,7 @@ protected:
 
   bool AppendXML;
   bool Quiet;
+  bool ScriptErrorOccurred;
   cmSystemTools::OutputOption HandlerVerbose;
   cmCTest *CTest;
   t_StringToString Options;
diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx
index 3003e8a..571e539 100644
--- a/Source/CTest/cmCTestHandlerCommand.cxx
+++ b/Source/CTest/cmCTestHandlerCommand.cxx
@@ -141,6 +141,12 @@ bool cmCTestHandlerCommand
   cmSystemTools::ChangeDirectory(
     this->CTest->GetCTestConfiguration("BuildDirectory"));
   int res = handler->ProcessHandler();
+  cmSystemTools::ChangeDirectory(current_dir);
+
+  if (handler->GetScriptErrorOccurred())
+    {
+    return false;
+    }
   if ( this->Values[ct_RETURN_VALUE] && *this->Values[ct_RETURN_VALUE])
     {
     std::ostringstream str;
@@ -148,7 +154,6 @@ bool cmCTestHandlerCommand
     this->Makefile->AddDefinition(
       this->Values[ct_RETURN_VALUE], str.str().c_str());
     }
-  cmSystemTools::ChangeDirectory(current_dir);
   return true;
 }
 
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 061f3fd..f603297 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -51,6 +51,7 @@ static void xmlReportError(int line, const char* msg, void* data)
   cmCTestLog(ctest, ERROR_MESSAGE,
              "Error parsing XML in stream at line "
              << line << ": " << msg << std::endl);
+  ctest->GetHandler("memcheck")->SetScriptErrorOccurred(true);
 }
 
 // parse the xml file containing the results of last BoundsChecker run
@@ -111,6 +112,7 @@ public:
         this->Errors.push_back(cmCTestMemCheckHandler::ABW); // do not know
         cmCTestLog(this->CTest, ERROR_MESSAGE,
                    "No Category found in Bounds checker XML\n" );
+        this->CTest->GetHandler("memcheck")->SetScriptErrorOccurred(true);
         return;
         }
       while(ptr->ErrorCategory && cat)
@@ -128,6 +130,7 @@ public:
         cmCTestLog(this->CTest, ERROR_MESSAGE,
                    "Found unknown Bounds Checker error "
                    << ptr->ErrorCategory << std::endl);
+        this->CTest->GetHandler("memcheck")->SetScriptErrorOccurred(true);
         }
     }
   cmCTest* CTest;
@@ -175,6 +178,7 @@ int cmCTestMemCheckHandler::PreProcessHandler()
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Problem executing pre-memcheck command(s)." << std::endl);
+    this->SetScriptErrorOccurred(true);
     return 0;
     }
   return 1;
@@ -187,6 +191,7 @@ int cmCTestMemCheckHandler::PostProcessHandler()
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Problem executing post-memcheck command(s)." << std::endl);
+    this->SetScriptErrorOccurred(true);
     return 0;
     }
   return 1;
@@ -646,6 +651,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
             "Cannot find memory checker suppression file: "
             << this->CTest->GetCTestConfiguration(
               "MemoryCheckSuppressionFile") << std::endl);
+          this->SetScriptErrorOccurred(true);
           return false;
           }
         std::string suppressions = "--suppressions="
@@ -671,6 +677,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
                      "Cannot find memory checker suppression file: "
                      << this->CTest->GetCTestConfiguration(
                        "MemoryCheckSuppressionFile").c_str() << std::endl);
+          this->SetScriptErrorOccurred(true);
           return false;
           }
         std::string filterFiles = "/FilterFiles="
@@ -742,6 +749,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "Do not understand memory checker: " << this->MemoryTester
         << std::endl);
+      this->SetScriptErrorOccurred(true);
       return false;
     }
 
@@ -908,6 +916,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput(
           << pfW.match(1) << std::endl);
         ostr << "*** Unknown Purify memory fault: " << pfW.match(1)
           << std::endl;
+        this->SetScriptErrorOccurred(true);
         }
       }
     if ( failure != this->ResultStrings.size() )
@@ -1143,6 +1152,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput(
         cmCTestLog(this->CTest, ERROR_MESSAGE,
                    "Error in ParseChunk: " << theLine
                    << std::endl);
+        this->SetScriptErrorOccurred(true);
         }
       }
     }
@@ -1217,6 +1227,7 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res,
     {
     std::string log = "Cannot read memory tester output file: " + ofile;
     cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl);
+    this->SetScriptErrorOccurred(true);
     return;
     }
   res.Output += BOUNDS_CHECKER_MARKER;
@@ -1252,6 +1263,7 @@ cmCTestMemCheckHandler::AppendMemTesterOutput(cmCTestTestResult& res,
     {
     std::string log = "Cannot read memory tester output file: " + ofile;
     cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl);
+    this->SetScriptErrorOccurred(true);
     return;
     }
   std::string line;
@@ -1290,6 +1302,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames(int test,
       std::string log = "Cannot find memory tester output file: "
         + ofile;
       cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl);
+      this->SetScriptErrorOccurred(true);
       ofile = "";
       }
     else
@@ -1303,6 +1316,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames(int test,
     std::string log = "Cannot find memory tester output file: "
       + ofile;
     cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl);
+    this->SetScriptErrorOccurred(true);
     ofile = "";
     }
   files.push_back(ofile);
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index d585863..ddb5f4c 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -235,6 +235,7 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
           << local_file << std::endl);
         ::curl_easy_cleanup(curl);
         ::curl_global_cleanup();
+        this->SetScriptErrorOccurred(true);
         return false;
         }
       unsigned long filelen = cmSystemTools::FileLength(local_file);
@@ -314,6 +315,7 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
         *this->LogFile << std::endl;
         ::curl_easy_cleanup(curl);
         ::curl_global_cleanup();
+        this->SetScriptErrorOccurred(true);
         return false;
         }
       // always cleanup
@@ -477,6 +479,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
           << local_file << std::endl);
         ::curl_easy_cleanup(curl);
         ::curl_global_cleanup();
+        this->SetScriptErrorOccurred(true);
         return false;
         }
       unsigned long filelen = cmSystemTools::FileLength(local_file);
@@ -621,6 +624,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
           }
         ::curl_easy_cleanup(curl);
         ::curl_global_cleanup();
+        this->SetScriptErrorOccurred(true);
         return false;
         }
       // always cleanup
@@ -783,6 +787,7 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
           }
         ::curl_easy_cleanup(curl);
         ::curl_global_cleanup();
+        this->SetScriptErrorOccurred(true);
         return false;
         }
 
@@ -908,6 +913,7 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(
   cmsysProcess_Delete(cp);
   if ( problems )
     {
+    this->SetScriptErrorOccurred(true);
     return false;
     }
   return true;
@@ -929,6 +935,7 @@ bool cmCTestSubmitHandler::SubmitUsingCP(
                << "\tNumber of files: " << files.size() << "\n"
                << "\tremoteprefix: " << remoteprefix << "\n"
                << "\tdestination: " << destination << std::endl);
+    this->SetScriptErrorOccurred(true);
     return 0;
     }
 
@@ -996,6 +1003,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
       {
       cmCTestLog(this->CTest, ERROR_MESSAGE, "  Cannot find file: "
         << local_file.c_str() << std::endl);
+      this->SetScriptErrorOccurred(true);
       return false;
       }
 
@@ -1006,6 +1014,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
       {
       cmCTestLog(this->CTest, ERROR_MESSAGE, "  File too big: "
         << local_file.c_str() << std::endl);
+      this->SetScriptErrorOccurred(true);
       return false;
       }
     size_t fileSize = static_cast<size_t>(st.st_size);
@@ -1014,6 +1023,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
       {
       cmCTestLog(this->CTest, ERROR_MESSAGE, "  Cannot open file: "
         << local_file.c_str() << std::endl);
+      this->SetScriptErrorOccurred(true);
       return false;
       }
 
@@ -1024,6 +1034,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
       fclose(fp);
       cmCTestLog(this->CTest, ERROR_MESSAGE, "  Cannot read file: "
         << local_file.c_str() << std::endl);
+      this->SetScriptErrorOccurred(true);
       return false;
       }
     fclose(fp);
@@ -1041,6 +1052,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const std::string& localprefix,
         << env.fault_string << " (" << env.fault_code << ")" << std::endl);
       xmlrpc_env_clean(&env);
       xmlrpc_client_cleanup();
+      this->SetScriptErrorOccurred(true);
       return false;
       }
 
@@ -1097,12 +1109,14 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Upload file not specified\n");
+    this->SetScriptErrorOccurred(true);
     return -1;
     }
   if (!cmSystemTools::FileExists(file))
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Upload file not found: '" << file << "'\n");
+    this->SetScriptErrorOccurred(true);
     return -1;
     }
   cmCTestCurl curl(this->CTest);
@@ -1120,6 +1134,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Only http and https are supported for CDASH_UPLOAD\n");
+    this->SetScriptErrorOccurred(true);
     return -1;
     }
   char md5sum[33];
@@ -1162,6 +1177,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Error in HttpRequest\n" << response);
+    this->SetScriptErrorOccurred(true);
     return -1;
     }
   cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
@@ -1173,6 +1189,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "error parsing json string [" << response << "]\n"
                << reader.getFormattedErrorMessages() << "\n");
+    this->SetScriptErrorOccurred(true);
     return -1;
     }
   if(json["status"].asInt() != 0)
@@ -1180,6 +1197,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "Bad status returned from CDash: "
                << json["status"].asInt());
+    this->SetScriptErrorOccurred(true);
     return -1;
     }
   if(json["datafilesmd5"].isArray())
@@ -1198,6 +1216,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "bad datafilesmd5 value in response "
                << response << "\n");
+    this->SetScriptErrorOccurred(true);
     return -1;
     }
 
@@ -1212,6 +1231,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "error uploading to CDash. "
                << file << " " << url << " " << fstr.str());
+    this->SetScriptErrorOccurred(true);
     return -1;
     }
   if(!reader.parse(response, json))
@@ -1219,6 +1239,7 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "error parsing json string [" << response << "]\n"
                << reader.getFormattedErrorMessages() << "\n");
+    this->SetScriptErrorOccurred(true);
     return -1;
     }
   cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
@@ -1249,6 +1270,7 @@ int cmCTestSubmitHandler::ProcessHandler()
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Cannot find BuildDirectory  key in the DartConfiguration.tcl"
       << std::endl);
+    this->SetScriptErrorOccurred(true);
     return -1;
     }
 
@@ -1457,6 +1479,7 @@ int cmCTestSubmitHandler::ProcessHandler()
         "   Problems when submitting via FTP"
         << std::endl);
       ofs << "   Problems when submitting via FTP" << std::endl;
+      this->SetScriptErrorOccurred(true);
       return -1;
       }
     if(!this->CDash)
@@ -1474,6 +1497,7 @@ int cmCTestSubmitHandler::ProcessHandler()
         cmCTestLog(this->CTest, ERROR_MESSAGE,
                    "   Problems when triggering via HTTP" << std::endl);
         ofs << "   Problems when triggering via HTTP" << std::endl;
+        this->SetScriptErrorOccurred(true);
         return -1;
         }
       cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
@@ -1517,6 +1541,7 @@ int cmCTestSubmitHandler::ProcessHandler()
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "   Problems when submitting via HTTP" << std::endl);
       ofs << "   Problems when submitting via HTTP" << std::endl;
+      this->SetScriptErrorOccurred(true);
       return -1;
       }
     if(!this->CDash)
@@ -1532,6 +1557,7 @@ int cmCTestSubmitHandler::ProcessHandler()
         cmCTestLog(this->CTest, ERROR_MESSAGE,
                    "   Problems when triggering via HTTP" << std::endl);
         ofs << "   Problems when triggering via HTTP" << std::endl;
+        this->SetScriptErrorOccurred(true);
         return -1;
         }
       }
@@ -1567,6 +1593,7 @@ int cmCTestSubmitHandler::ProcessHandler()
       cmCTestLog(this->CTest, ERROR_MESSAGE,
         "   Problems when submitting via XML-RPC" << std::endl);
       ofs << "   Problems when submitting via XML-RPC" << std::endl;
+      this->SetScriptErrorOccurred(true);
       return -1;
       }
     cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "   Submission successful"
@@ -1577,6 +1604,7 @@ int cmCTestSubmitHandler::ProcessHandler()
     cmCTestLog(this->CTest, ERROR_MESSAGE,
                "   Submission method \"xmlrpc\" not compiled into CTest!"
                << std::endl);
+    this->SetScriptErrorOccurred(true);
     return -1;
 #endif
     }
@@ -1605,6 +1633,7 @@ int cmCTestSubmitHandler::ProcessHandler()
         "   Problems when submitting via SCP"
         << std::endl);
       ofs << "   Problems when submitting via SCP" << std::endl;
+      this->SetScriptErrorOccurred(true);
       return -1;
       }
     cmSystemTools::ChangeDirectory(oldWorkingDirectory);
@@ -1638,6 +1667,7 @@ int cmCTestSubmitHandler::ProcessHandler()
         "   Problems when submitting via CP"
         << std::endl);
       ofs << "   Problems when submitting via cp" << std::endl;
+      this->SetScriptErrorOccurred(true);
       return -1;
       }
     cmSystemTools::ChangeDirectory(oldWorkingDirectory);
@@ -1649,6 +1679,7 @@ int cmCTestSubmitHandler::ProcessHandler()
 
   cmCTestLog(this->CTest, ERROR_MESSAGE, "   Unknown submission method: \""
     << dropMethod << "\"" << std::endl);
+  this->SetScriptErrorOccurred(true);
   return -1;
 }
 
diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx
index b18786a..57e9216 100644
--- a/Source/CTest/cmCTestUpdateHandler.cxx
+++ b/Source/CTest/cmCTestUpdateHandler.cxx
@@ -204,6 +204,7 @@ int cmCTestUpdateHandler::ProcessHandler()
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Cannot find SourceDirectory  key in the DartConfiguration.tcl"
       << std::endl);
+    this->SetScriptErrorOccurred(true);
     return -1;
     }
 
@@ -253,6 +254,7 @@ int cmCTestUpdateHandler::ProcessHandler()
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE, "Cannot open log file"
       << std::endl);
+    this->SetScriptErrorOccurred(true);
     return -1;
     }
   std::string start_time = this->CTest->CurrentTime();
@@ -318,12 +320,14 @@ int cmCTestUpdateHandler::ProcessHandler()
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "   There are modified or conflicting files in the repository"
       << std::endl);
+    this->SetScriptErrorOccurred(true);
     }
   if(!updated)
     {
     os << "Update command failed:\n" << vc->GetUpdateCommandLine();
     cmCTestLog(this->CTest, ERROR_MESSAGE, "   Update command failed: "
                << vc->GetUpdateCommandLine() << "\n");
+    this->SetScriptErrorOccurred(true);
     }
   os << "</UpdateReturnStatus>" << std::endl;
   os << "</Update>" << std::endl;
@@ -424,6 +428,7 @@ bool cmCTestUpdateHandler::SelectVCS()
         }
       e << " configuration key.";
       cmCTestLog(this->CTest, ERROR_MESSAGE, e.str() << std::endl);
+      this->SetScriptErrorOccurred(true);
       return false;
       }
     }
diff --git a/Source/CTest/cmCTestUploadHandler.cxx b/Source/CTest/cmCTestUploadHandler.cxx
index 579190a..965f88e 100644
--- a/Source/CTest/cmCTestUploadHandler.cxx
+++ b/Source/CTest/cmCTestUploadHandler.cxx
@@ -42,6 +42,7 @@ int cmCTestUploadHandler::ProcessHandler()
     {
     cmCTestLog(this->CTest, ERROR_MESSAGE,
       "Cannot open Upload.xml file" << std::endl);
+    this->SetScriptErrorOccurred(true);
     return -1;
     }
   std::string buildname = cmCTest::SafeBuildIdField(
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index e6d3960..aec943e 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -3122,7 +3122,6 @@ void cmCTest::Log(int logType, const char* file, int line, const char* msg,
       cmCTestLogOutputFileLine(err);
       err << msg;
       err.flush();
-      cmSystemTools::SetErrorOccured();
       break;
     default:
       cmCTestLogOutputFileLine(out);
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index ccfe2b1..f989aff 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -382,8 +382,21 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
         {
         if(!status.GetNestedError())
           {
-          // The command invocation requested that we report an error.
-          this->IssueMessage(cmake::FATAL_ERROR, pcmd->GetError());
+          if (cmSystemTools::GetFilenameName(
+              this->GetSafeDefinition("CMAKE_CURRENT_LIST_FILE")) ==
+              this->GetSafeDefinition("CTEST_SCRIPT_NAME") &&
+              std::string(pcmd->GetError()).find("unknown error") !=
+              std::string::npos)
+            {
+            // Don't report "unknown error" from a CTest script.
+            // Instead simply note that an error occurred.
+            cmSystemTools::SetFatalErrorOccured();
+            }
+          else
+            {
+            // The command invocation requested that we report an error.
+            this->IssueMessage(cmake::FATAL_ERROR, pcmd->GetError());
+            }
           }
         result = false;
         if ( this->GetCMakeInstance()->GetWorkingMode() != cmake::NORMAL_MODE)

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list