summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestSubmitHandler.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-07-06 19:11:38 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-07-06 19:11:38 (GMT)
commitf1f141fe7da8c1e42297de6221593ebd7ba959dd (patch)
tree575387c455f1507a1b8aca20d902517eca9a0822 /Source/CTest/cmCTestSubmitHandler.cxx
parentc6cb18da43536476e8b663b669f8b7e46c8ca296 (diff)
downloadCMake-f1f141fe7da8c1e42297de6221593ebd7ba959dd.zip
CMake-f1f141fe7da8c1e42297de6221593ebd7ba959dd.tar.gz
CMake-f1f141fe7da8c1e42297de6221593ebd7ba959dd.tar.bz2
BUG: On windows there can be a problem because scp does not handle drive names. This uses relative path for scp
Diffstat (limited to 'Source/CTest/cmCTestSubmitHandler.cxx')
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index d710f22..45fbcfc 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -502,15 +502,19 @@ bool cmCTestSubmitHandler::SubmitUsingSCP(
<< argv[2] << "\"" << std::endl);
*m_LogFile << "Execute \"" << argv[0] << "\" \"" << argv[1] << "\" \""
<< argv[2] << "\"" << std::endl;
+
cmsysProcess_SetCommand(cp, &*argv.begin());
cmsysProcess_Execute(cp);
char* data;
int length;
+
while(cmsysProcess_WaitForData(cp, &data, &length, 0))
{
cmCTestLog(m_CTest, HANDLER_VERBOSE_OUTPUT, cmCTestLogWrite(data, length));
}
+
cmsysProcess_WaitForExit(cp, 0);
+
int result = cmsysProcess_GetState(cp);
if(result == cmsysProcess_State_Exited)
@@ -868,23 +872,32 @@ int cmCTestSubmitHandler::ProcessHandler()
else if ( m_CTest->GetCTestConfiguration("DropMethod") == "scp" )
{
std::string url;
+ std::string oldWorkingDirectory;
if ( m_CTest->GetCTestConfiguration("DropSiteUser").size() > 0 )
{
url += m_CTest->GetCTestConfiguration("DropSiteUser") + "@";
}
url += m_CTest->GetCTestConfiguration("DropSite") + ":" + m_CTest->GetCTestConfiguration("DropLocation");
+ // change to the build directory so that we can uses a relative path
+ // on windows since scp dosn't support "c:" a drive in the path
+ oldWorkingDirectory = cmSystemTools::GetCurrentWorkingDirectory();
+ cmSystemTools::ChangeDirectory(buildDirectory.c_str());
+
if ( !this->SubmitUsingSCP(m_CTest->GetCTestConfiguration("ScpCommand"),
- buildDirectory+"/Testing/"+m_CTest->GetCurrentTag(), files, prefix, url) )
+ "Testing/"+m_CTest->GetCurrentTag(), files, prefix, url) )
{
+ cmSystemTools::ChangeDirectory(oldWorkingDirectory.c_str());
cmCTestLog(m_CTest, ERROR_MESSAGE, " Problems when submitting via SCP" << std::endl);
ofs << " Problems when submitting via SCP" << std::endl;
return -1;
}
+ cmSystemTools::ChangeDirectory(oldWorkingDirectory.c_str());
cmCTestLog(m_CTest, HANDLER_OUTPUT, " Submission successful" << std::endl);
ofs << " Submission successful" << std::endl;
return 0;
}
+
cmCTestLog(m_CTest, ERROR_MESSAGE, " Unknown submission method: \"" << m_CTest->GetCTestConfiguration("DropMethod") << "\"" << std::endl);
return -1;
}