summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeLists.txt2
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx3
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx3
-rw-r--r--Source/CPack/cmCPackGenerator.cxx19
-rw-r--r--Source/CPack/cmCPackGenerator.h6
-rw-r--r--Source/CPack/cmCPackRPMGenerator.cxx3
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx2
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx1
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx44
-rw-r--r--Source/CTest/cmCTestTestHandler.h2
-rw-r--r--Source/CTest/cmCTestUploadCommand.cxx69
-rw-r--r--Source/CTest/cmCTestUploadCommand.h85
-rw-r--r--Source/CTest/cmCTestUploadHandler.cxx77
-rw-r--r--Source/CTest/cmCTestUploadHandler.h45
-rw-r--r--Source/cmCTest.cxx56
-rw-r--r--Source/cmCTest.h10
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx26
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake4
18 files changed, 388 insertions, 69 deletions
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 278d4df..e284967 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -394,6 +394,8 @@ SET(CTEST_SRCS cmCTest.cxx
CTest/cmCTestTestHandler.cxx
CTest/cmCTestUpdateCommand.cxx
CTest/cmCTestUpdateHandler.cxx
+ CTest/cmCTestUploadCommand.cxx
+ CTest/cmCTestUploadHandler.cxx
CTest/cmCTestVC.cxx
CTest/cmCTestVC.h
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index 5b4625b..0ce5b01 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -254,7 +254,8 @@ int cmCPackArchiveGenerator::PackageFiles()
// in this case you'll get 1 package for each component.
else
{
- return PackageComponents(componentPackageMethod == ONE_PACKAGE_PER_COMPONENT);
+ return PackageComponents(componentPackageMethod ==
+ ONE_PACKAGE_PER_COMPONENT);
}
}
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 582f3e6..5665404 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -250,7 +250,8 @@ int cmCPackDebGenerator::PackageFiles()
// in this case you'll get 1 package for each component.
else
{
- return PackageComponents(componentPackageMethod == ONE_PACKAGE_PER_COMPONENT);
+ return PackageComponents(componentPackageMethod ==
+ ONE_PACKAGE_PER_COMPONENT);
}
}
// CASE 3 : NON COMPONENT package.
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 6d71ad2..c8a77d1 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -1307,10 +1307,10 @@ int cmCPackGenerator::PrepareGroupingKind()
else
{
cmCPackLogger(cmCPackLog::LOG_WARNING, "["
- << this->Name << "]"
- << " requested component grouping type <"<< groupingType
- << "> UNKNOWN not in (ALL_COMPONENTS_IN_ONE,IGNORE,ONE_PER_GROUP)"
- << std::endl);
+ << this->Name << "]"
+ << " requested component grouping type <"<< groupingType
+ << "> UNKNOWN not in (ALL_COMPONENTS_IN_ONE,IGNORE,ONE_PER_GROUP)"
+ << std::endl);
}
}
@@ -1328,10 +1328,10 @@ int cmCPackGenerator::PrepareGroupingKind()
method = ONE_PACKAGE_PER_COMPONENT;
}
cmCPackLogger(cmCPackLog::LOG_WARNING, "["
- << this->Name << "]"
- << " One package per component group requested, but NO component groups exist:"
- << " Ignoring component group."
- << std::endl);
+ << this->Name << "]"
+ << " One package per component group requested, "
+ << "but NO component groups exist: Ignoring component group."
+ << std::endl);
}
// if user specified packaging method, override the default packaging method
@@ -1349,7 +1349,8 @@ int cmCPackGenerator::PrepareGroupingKind()
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "["
<< this->Name << "]"
- << " requested component grouping = " << method_names[componentPackageMethod]
+ << " requested component grouping = "
+ << method_names[componentPackageMethod]
<< std::endl);
return 1;
diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h
index f09c2a7..05d95b8 100644
--- a/Source/CPack/cmCPackGenerator.h
+++ b/Source/CPack/cmCPackGenerator.h
@@ -248,14 +248,16 @@ protected:
ONE_PACKAGE,
/* one package for each component */
ONE_PACKAGE_PER_COMPONENT,
- /* one package for each group, with left over components in their own package */
+ /* one package for each group,
+ * with left over components in their own package */
ONE_PACKAGE_PER_GROUP,
UNKNOWN_COMPONENT_PACKAGE_METHOD
};
/**
* The component package method
- * The default is ONE_PACKAGE_PER_GROUP, and generators may override the default
+ * The default is ONE_PACKAGE_PER_GROUP,
+ * and generators may override the default
* before PrepareGroupingKind() is called.
*/
ComponentPackageMethod componentPackageMethod;
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index 9f55d23..1a6c3be 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -215,7 +215,8 @@ int cmCPackRPMGenerator::PackageFiles()
// in this case you'll get 1 package for each component.
else
{
- return PackageComponents(componentPackageMethod == ONE_PACKAGE_PER_COMPONENT);
+ return PackageComponents(componentPackageMethod ==
+ ONE_PACKAGE_PER_COMPONENT);
}
}
// CASE 3 : NON COMPONENT package.
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index 12d5fd1..5841b8d 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -50,6 +50,7 @@
#include "cmCTestSubmitCommand.h"
#include "cmCTestTestCommand.h"
#include "cmCTestUpdateCommand.h"
+#include "cmCTestUploadCommand.h"
#define CTEST_INITIAL_CMAKE_OUTPUT_FILE_NAME "CTestInitialCMakeOutput.log"
@@ -357,6 +358,7 @@ void cmCTestScriptHandler::CreateCMake()
this->AddCTestCommand(new cmCTestSubmitCommand);
this->AddCTestCommand(new cmCTestTestCommand);
this->AddCTestCommand(new cmCTestUpdateCommand);
+ this->AddCTestCommand(new cmCTestUploadCommand);
}
void cmCTestScriptHandler::GetCommandDocumentation(
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 43441c0..142bb46 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -1204,6 +1204,7 @@ int cmCTestSubmitHandler::ProcessHandler()
this->CTest->AddIfExists(cmCTest::PartMemCheck, "DynamicAnalysis.xml");
this->CTest->AddIfExists(cmCTest::PartMemCheck, "Purify.xml");
this->CTest->AddIfExists(cmCTest::PartNotes, "Notes.xml");
+ this->CTest->AddIfExists(cmCTest::PartUpload, "Upload.xml");
// Query parts for files to submit.
for(cmCTest::Part p = cmCTest::PartStart;
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index f87c929..bad26c5 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1282,7 +1282,7 @@ void cmCTestTestHandler::AttachFiles(std::ostream& os,
result->Properties->AttachedFiles.begin();
file != result->Properties->AttachedFiles.end(); ++file)
{
- std::string base64 = this->EncodeFile(*file);
+ std::string base64 = this->CTest->Base64GzipEncodeFile(*file);
std::string fname = cmSystemTools::GetFilenameName(*file);
os << "\t\t<NamedMeasurement name=\"Attached File\" encoding=\"base64\" "
"compression=\"tar/gzip\" filename=\"" << fname << "\" type=\"file\">"
@@ -1293,48 +1293,6 @@ void cmCTestTestHandler::AttachFiles(std::ostream& os,
}
//----------------------------------------------------------------------
-std::string cmCTestTestHandler::EncodeFile(std::string file)
-{
- std::string tarFile = file + "_temp.tar.gz";
- std::vector<cmStdString> files;
- files.push_back(file);
-
- if(!cmSystemTools::CreateTar(tarFile.c_str(), files, true, false, false))
- {
- cmCTestLog(this->CTest, ERROR_MESSAGE, "Error creating tar while "
- "attaching file: " << file << std::endl);
- return "";
- }
- long len = cmSystemTools::FileLength(tarFile.c_str());
- std::ifstream ifs(tarFile.c_str(), std::ios::in
-#ifdef _WIN32
- | std::ios::binary
-#endif
- );
- unsigned char *file_buffer = new unsigned char [ len + 1 ];
- ifs.read(reinterpret_cast<char*>(file_buffer), len);
- ifs.close();
- cmSystemTools::RemoveFile(tarFile.c_str());
-
- unsigned char *encoded_buffer
- = new unsigned char [ static_cast<int>(
- static_cast<double>(len) * 1.5 + 5.0) ];
-
- unsigned long rlen
- = cmsysBase64_Encode(file_buffer, len, encoded_buffer, 1);
-
- std::string base64 = "";
- for(unsigned long i = 0; i < rlen; i++)
- {
- base64 += encoded_buffer[i];
- }
- delete [] file_buffer;
- delete [] encoded_buffer;
-
- return base64;
-}
-
-//----------------------------------------------------------------------
int cmCTestTestHandler::ExecuteCommands(std::vector<cmStdString>& vec)
{
std::vector<cmStdString>::iterator it;
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index 2c4b230..3089d35 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -151,8 +151,6 @@ protected:
void WriteTestResultFooter(std::ostream& os, cmCTestTestResult* result);
// Write attached test files into the xml
void AttachFiles(std::ostream& os, cmCTestTestResult* result);
- // Helper function to encode attached test files
- std::string EncodeFile(std::string file);
//! Clean test output to specified length
bool CleanTestOutput(std::string& output, size_t length);
diff --git a/Source/CTest/cmCTestUploadCommand.cxx b/Source/CTest/cmCTestUploadCommand.cxx
new file mode 100644
index 0000000..731c1c7
--- /dev/null
+++ b/Source/CTest/cmCTestUploadCommand.cxx
@@ -0,0 +1,69 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#include "cmCTestUploadCommand.h"
+
+#include "cmCTest.h"
+#include "cmCTestGenericHandler.h"
+#include "cmCTestUploadHandler.h"
+
+cmCTestGenericHandler* cmCTestUploadCommand::InitializeHandler()
+{
+ cmCTestGenericHandler* handler
+ = this->CTest->GetInitializedHandler("upload");
+ if ( !handler )
+ {
+ this->SetError("internal CTest error. Cannot instantiate upload handler");
+ return 0;
+ }
+ static_cast<cmCTestUploadHandler*>(handler)->SetFiles(this->Files);
+
+ return handler;
+}
+
+
+//----------------------------------------------------------------------------
+bool cmCTestUploadCommand::CheckArgumentKeyword(std::string const& arg)
+{
+ if(arg == "FILES")
+ {
+ this->ArgumentDoing = ArgumentDoingFiles;
+ return true;
+ }
+ return false;
+}
+
+
+//----------------------------------------------------------------------------
+bool cmCTestUploadCommand::CheckArgumentValue(std::string const& arg)
+{
+ if(this->ArgumentDoing == ArgumentDoingFiles)
+ {
+ cmStdString filename(arg);
+ if(cmSystemTools::FileExists(filename.c_str()))
+ {
+ this->Files.insert(filename);
+ return true;
+ }
+ else
+ {
+ cmOStringStream e;
+ e << "File \"" << filename << "\" does not exist. Cannot submit "
+ << "a non-existent file.";
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->ArgumentDoing = ArgumentDoingError;
+ return false;
+ }
+ }
+
+ // Look for other arguments.
+ return this->Superclass::CheckArgumentValue(arg);
+}
diff --git a/Source/CTest/cmCTestUploadCommand.h b/Source/CTest/cmCTestUploadCommand.h
new file mode 100644
index 0000000..6c2a4c2
--- /dev/null
+++ b/Source/CTest/cmCTestUploadCommand.h
@@ -0,0 +1,85 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cmCTestUploadCommand_h
+#define cmCTestUploadCommand_h
+
+#include "cmCTestHandlerCommand.h"
+#include "cmCTest.h"
+
+/** \class cmCTestUpload
+ * \brief Run a ctest script
+ *
+ * cmCTestUploadCommand defines the command to upload result files for
+ * the project.
+ */
+class cmCTestUploadCommand : public cmCTestHandlerCommand
+{
+public:
+
+ cmCTestUploadCommand()
+ {
+ }
+
+ /**
+ * This is a virtual constructor for the command.
+ */
+ virtual cmCommand* Clone()
+ {
+ cmCTestUploadCommand* ni = new cmCTestUploadCommand;
+ ni->CTest = this->CTest;
+ ni->CTestScriptHandler = this->CTestScriptHandler;
+ return ni;
+ }
+
+ /**
+ * The name of the command as specified in CMakeList.txt.
+ */
+ virtual const char* GetName() { return "ctest_upload";}
+
+ /**
+ * Succinct documentation.
+ */
+ virtual const char* GetTerseDocumentation()
+ {
+ return "Upload files to a dashboard server.";
+ }
+
+ /**
+ * More documentation.
+ */
+ virtual const char* GetFullDocumentation()
+ {
+ return
+ " ctest_upload(FILES ...)\n"
+ "Pass a list of files to be sent along with the build results to "
+ "the dashboard server.\n";
+ }
+
+ cmTypeMacro(cmCTestUploadCommand, cmCTestHandlerCommand);
+
+protected:
+ cmCTestGenericHandler* InitializeHandler();
+
+ virtual bool CheckArgumentKeyword(std::string const& arg);
+ virtual bool CheckArgumentValue(std::string const& arg);
+
+ enum
+ {
+ ArgumentDoingFiles = Superclass::ArgumentDoingLast1,
+ ArgumentDoingLast2
+ };
+
+ cmCTest::SetOfStrings Files;
+};
+
+
+#endif
diff --git a/Source/CTest/cmCTestUploadHandler.cxx b/Source/CTest/cmCTestUploadHandler.cxx
new file mode 100644
index 0000000..caf2e53
--- /dev/null
+++ b/Source/CTest/cmCTestUploadHandler.cxx
@@ -0,0 +1,77 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc.
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#include "cmCTestUploadHandler.h"
+
+#include "cmGeneratedFileStream.h"
+#include "cmVersion.h"
+#include "cmXMLSafe.h"
+
+//----------------------------------------------------------------------------
+cmCTestUploadHandler::cmCTestUploadHandler()
+{
+ this->Initialize();
+}
+
+//----------------------------------------------------------------------------
+void cmCTestUploadHandler::Initialize()
+{
+ this->Superclass::Initialize();
+ this->Files.clear();
+}
+
+void cmCTestUploadHandler::SetFiles(const cmCTest::SetOfStrings& files)
+{
+ this->Files = files;
+}
+
+//----------------------------------------------------------------------------
+int cmCTestUploadHandler::ProcessHandler()
+{
+ cmGeneratedFileStream ofs;
+ if ( !this->CTest->OpenOutputFile(this->CTest->GetCurrentTag(),
+ "Upload.xml", ofs))
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Cannot open Upload.xml file" << std::endl);
+ return -1;
+ }
+
+ cmCTest::SetOfStrings::const_iterator it;
+ ofs << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ << "<?xml-stylesheet type=\"text/xsl\" "
+ "href=\"Dart/Source/Server/XSL/Build.xsl "
+ "<file:///Dart/Source/Server/XSL/Build.xsl> \"?>\n"
+ << "<Site BuildName=\""
+ << this->CTest->GetCTestConfiguration("BuildName")
+ << "\" BuildStamp=\""
+ << this->CTest->GetCurrentTag() << "-"
+ << this->CTest->GetTestModelString() << "\" Name=\""
+ << this->CTest->GetCTestConfiguration("Site") << "\" Generator=\"ctest"
+ << cmVersion::GetCMakeVersion()
+ << "\">\n";
+ this->CTest->AddSiteProperties(ofs);
+ ofs << "<Upload>\n";
+
+ for ( it = this->Files.begin(); it != this->Files.end(); it ++ )
+ {
+ cmCTestLog(this->CTest, OUTPUT,
+ "\tUpload file: " << it->c_str() << std::endl);
+ ofs << "<File filename=\"" << cmXMLSafe(*it) << "\">\n"
+ << "<Content encoding=\"base64\">\n";
+ ofs << this->CTest->Base64EncodeFile(*it);
+ ofs << "\n</Content>\n"
+ << "</File>\n";
+ }
+ ofs << "</Upload>\n"
+ << "</Site>\n";
+ return 0;
+}
diff --git a/Source/CTest/cmCTestUploadHandler.h b/Source/CTest/cmCTestUploadHandler.h
new file mode 100644
index 0000000..23ed35a
--- /dev/null
+++ b/Source/CTest/cmCTestUploadHandler.h
@@ -0,0 +1,45 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cmCTestUploadHandler_h
+#define cmCTestUploadHandler_h
+
+#include "cmCTestGenericHandler.h"
+
+/** \class cmCTestUploadHandler
+ * \brief Helper class for CTest
+ *
+ * Submit arbitrary files
+ *
+ */
+class cmCTestUploadHandler : public cmCTestGenericHandler
+{
+public:
+ cmTypeMacro(cmCTestUploadHandler, cmCTestGenericHandler);
+
+ cmCTestUploadHandler();
+ ~cmCTestUploadHandler() {}
+
+ /*
+ * The main entry point for this class
+ */
+ int ProcessHandler();
+
+ void Initialize();
+
+ /** Specify a set of files to submit. */
+ void SetFiles(cmCTest::SetOfStrings const& files);
+
+private:
+ cmCTest::SetOfStrings Files;
+};
+
+#endif
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 2e05883..70b1c01 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -16,6 +16,7 @@
#include "cmMakefile.h"
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
+#include <cmsys/Base64.h>
#include <cmsys/Directory.hxx>
#include <cmsys/SystemInformation.hxx>
#include "cmDynamicLoader.h"
@@ -31,9 +32,10 @@
#include "cmCTestCoverageHandler.h"
#include "cmCTestMemCheckHandler.h"
#include "cmCTestScriptHandler.h"
+#include "cmCTestSubmitHandler.h"
#include "cmCTestTestHandler.h"
#include "cmCTestUpdateHandler.h"
-#include "cmCTestSubmitHandler.h"
+#include "cmCTestUploadHandler.h"
#include "cmVersion.h"
@@ -339,6 +341,7 @@ cmCTest::cmCTest()
this->Parts[PartSubmit].SetName("Submit");
this->Parts[PartNotes].SetName("Notes");
this->Parts[PartExtraFiles].SetName("ExtraFiles");
+ this->Parts[PartUpload].SetName("Upload");
// Fill the part name-to-id map.
for(Part p = PartStart; p != PartCount; p = Part(p+1))
@@ -357,6 +360,7 @@ cmCTest::cmCTest()
this->TestingHandlers["configure"] = new cmCTestConfigureHandler;
this->TestingHandlers["memcheck"] = new cmCTestMemCheckHandler;
this->TestingHandlers["submit"] = new cmCTestSubmitHandler;
+ this->TestingHandlers["upload"] = new cmCTestUploadHandler;
cmCTest::t_TestingHandlers::iterator it;
for ( it = this->TestingHandlers.begin();
@@ -1584,6 +1588,56 @@ int cmCTest::GenerateNotesFile(const char* cfiles)
}
//----------------------------------------------------------------------
+std::string cmCTest::Base64GzipEncodeFile(std::string file)
+{
+ std::string tarFile = file + "_temp.tar.gz";
+ std::vector<cmStdString> files;
+ files.push_back(file);
+
+ if(!cmSystemTools::CreateTar(tarFile.c_str(), files, true, false, false))
+ {
+ cmCTestLog(this, ERROR_MESSAGE, "Error creating tar while "
+ "encoding file: " << file << std::endl);
+ return "";
+ }
+ std::string base64 = this->Base64EncodeFile(tarFile);
+ cmSystemTools::RemoveFile(tarFile.c_str());
+ return base64;
+}
+
+//----------------------------------------------------------------------
+std::string cmCTest::Base64EncodeFile(std::string file)
+{
+ long len = cmSystemTools::FileLength(file.c_str());
+ std::ifstream ifs(file.c_str(), std::ios::in
+#ifdef _WIN32
+ | std::ios::binary
+#endif
+ );
+ unsigned char *file_buffer = new unsigned char [ len + 1 ];
+ ifs.read(reinterpret_cast<char*>(file_buffer), len);
+ ifs.close();
+
+ unsigned char *encoded_buffer
+ = new unsigned char [ static_cast<int>(
+ static_cast<double>(len) * 1.5 + 5.0) ];
+
+ unsigned long rlen
+ = cmsysBase64_Encode(file_buffer, len, encoded_buffer, 1);
+
+ std::string base64 = "";
+ for(unsigned long i = 0; i < rlen; i++)
+ {
+ base64 += encoded_buffer[i];
+ }
+ delete [] file_buffer;
+ delete [] encoded_buffer;
+
+ return base64;
+}
+
+
+//----------------------------------------------------------------------
bool cmCTest::SubmitExtraFiles(const std::vector<cmStdString> &files)
{
std::vector<cmStdString>::const_iterator it;
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index e54a205..3b02748 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -61,6 +61,7 @@ public:
PartSubmit,
PartNotes,
PartExtraFiles,
+ PartUpload,
PartCount // Update names in constructor when adding a part
};
@@ -192,8 +193,13 @@ public:
///! Get the current time as string
std::string CurrentTime();
+ //! tar/gzip and then base 64 encode a file
+ std::string Base64GzipEncodeFile(std::string file);
+ //! base64 encode a file
+ std::string Base64EncodeFile(std::string file);
+
/**
- * Return the time remaianing that the script is allowed to run in
+ * Return the time remaining that the script is allowed to run in
* seconds if the user has set the variable CTEST_TIME_LIMIT. If that has
* not been set it returns 1e7 seconds
*/
@@ -515,7 +521,7 @@ private:
//! Reread the configuration file
bool UpdateCTestConfiguration();
- //! Create not from files.
+ //! Create note from files.
int GenerateCTestNotesOutput(std::ostream& os,
const VectorOfStrings& files);
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index f872838..b8fef25 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -449,6 +449,8 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
bool header = (*s)->GetPropertyAsBool("HEADER_FILE_ONLY")
|| this->GlobalGenerator->IgnoreFile
((*s)->GetExtension().c_str());
+ std::string ext =
+ cmSystemTools::LowerCase((*s)->GetExtension());
if(!lang)
{
lang = "None";
@@ -469,7 +471,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
{
headers.push_back(sf);
}
- else if(sf->GetExtension() == "idl")
+ else if(ext == "idl")
{
idls.push_back(sf);
}
@@ -636,14 +638,28 @@ void cmVisualStudio10TargetGenerator::WriteObjSources()
for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
source != sources.end(); ++source)
{
- if((*source)->GetExtension() == "obj")
+ std::string ext =
+ cmSystemTools::LowerCase((*source)->GetExtension());
+ if(ext == "obj" || ext == "o")
{
if(first)
{
this->WriteString("<ItemGroup>\n", 1);
first = false;
}
- this->WriteString("<None Include=\"", 2);
+ // If an object file is generated, then vs10
+ // will use it in the build, and we have to list
+ // it as None instead of Object
+ if((*source)->GetPropertyAsBool("GENERATED"))
+ {
+ this->WriteString("<None Include=\"", 2);
+ }
+ // If it is not a generated object then we have
+ // to use the Object type
+ else
+ {
+ this->WriteString("<Object Include=\"", 2);
+ }
(*this->BuildFileStream ) << (*source)->GetFullPath() << "\" />\n";
}
}
@@ -665,8 +681,8 @@ void cmVisualStudio10TargetGenerator::WriteCLSources()
for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
source != sources.end(); ++source)
{
- std::string ext = (*source)->GetExtension();
- if((*source)->GetCustomCommand() || ext == "obj")
+ std::string ext = cmSystemTools::LowerCase((*source)->GetExtension());
+ if((*source)->GetCustomCommand() || ext == "o" || ext == "obj")
{
continue;
}
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index e2e7d02..27324f6 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -15,7 +15,7 @@
SET(KWSYS_DATE_STAMP_YEAR 2011)
# KWSys version date month component. Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 03)
+SET(KWSYS_DATE_STAMP_MONTH 04)
# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY 31)
+SET(KWSYS_DATE_STAMP_DAY 05)