From d66436e2e4b1e4d58fb2e7b7bb50e15fc7c30845 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 20 Mar 2009 14:19:56 -0400 Subject: BUG: Fix return value of ctest_update The CTest version control refactoring broke the value returned for the ctest_update command's RETURN_VALUE argument. The value is supposed to be the number of files updated, but the refactoring accidentally made it the number of locally modified files after the update. --- Source/CTest/cmCTestUpdateCommand.h | 3 +-- Source/CTest/cmCTestUpdateHandler.cxx | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/CTest/cmCTestUpdateCommand.h b/Source/CTest/cmCTestUpdateCommand.h index 6bcdd23..9d86d9d 100644 --- a/Source/CTest/cmCTestUpdateCommand.h +++ b/Source/CTest/cmCTestUpdateCommand.h @@ -64,8 +64,7 @@ public: "Updates the given source directory and stores results in Update.xml. " "If no SOURCE is given, the CTEST_SOURCE_DIRECTORY variable is used. " "The RETURN_VALUE option specifies a variable in which to store the " - "result, which is -1 on error, non-negative for success, and positive " - "if there are local modifications in the work tree." + "result, which is the number of files updated or -1 on error." ; } diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index 5f4dfc0..41a6540 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -248,7 +248,8 @@ int cmCTestUpdateHandler::ProcessHandler() vc->WriteXML(os); int localModifications = 0; - if(int numUpdated = vc->GetPathCount(cmCTestVC::PathUpdated)) + int numUpdated = vc->GetPathCount(cmCTestVC::PathUpdated); + if(numUpdated) { cmCTestLog(this->CTest, HANDLER_OUTPUT, " Found " << numUpdated << " updated files\n"); @@ -290,7 +291,7 @@ int cmCTestUpdateHandler::ProcessHandler() } os << "" << std::endl; os << "" << std::endl; - return localModifications; + return numUpdated; } //---------------------------------------------------------------------- -- cgit v0.12