summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRegina Pfeifer <regina@mailbox.org>2018-11-27 21:35:00 (GMT)
committerRegina Pfeifer <regina@mailbox.org>2018-11-28 23:29:13 (GMT)
commitc339b64cf241788edd9f886daff619eec41dc242 (patch)
tree73b5ca521097268ec61d66c72d8ce40b78d8ca2e
parentaebdad399efb1394f904428b52011513f7dd0b7c (diff)
downloadCMake-c339b64cf241788edd9f886daff619eec41dc242.zip
CMake-c339b64cf241788edd9f886daff619eec41dc242.tar.gz
CMake-c339b64cf241788edd9f886daff619eec41dc242.tar.bz2
CTest: Remove submit method 'scp'
-rw-r--r--Help/manual/ctest.1.rst6
-rw-r--r--Help/variable/CTEST_SCP_COMMAND.rst3
-rw-r--r--Modules/CTest.cmake3
-rw-r--r--Modules/DartConfiguration.tcl.in1
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx2
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx133
-rw-r--r--Source/CTest/cmCTestSubmitHandler.h4
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-scp-result.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-scp-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-scp-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/RunCMakeTest.cmake1
11 files changed, 4 insertions, 152 deletions
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 511764c..1ac5efd 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -1106,8 +1106,8 @@ Configuration settings include:
``DropMethod``
Specify the method by which results should be submitted to the
- dashboard server. The value may be ``ftp``, ``http``,
- ``https``, or ``scp``.
+ dashboard server. The value may be ``ftp``, ``http``, or
+ ``https``.
* `CTest Script`_ variable: :variable:`CTEST_DROP_METHOD`
* :module:`CTest` module variable: ``DROP_METHOD`` if set,
@@ -1144,7 +1144,7 @@ Configuration settings include:
* :module:`CTest` module variable: ``CTEST_DROP_SITE_CDASH``
``ScpCommand``
- ``scp`` command-line tool to use when ``DropMethod`` is ``scp``.
+ Legacy option. Not used.
* `CTest Script`_ variable: :variable:`CTEST_SCP_COMMAND`
* :module:`CTest` module variable: ``SCPCOMMAND``
diff --git a/Help/variable/CTEST_SCP_COMMAND.rst b/Help/variable/CTEST_SCP_COMMAND.rst
index 0f128b1..19ea8b3 100644
--- a/Help/variable/CTEST_SCP_COMMAND.rst
+++ b/Help/variable/CTEST_SCP_COMMAND.rst
@@ -1,5 +1,4 @@
CTEST_SCP_COMMAND
-----------------
-Specify the CTest ``SCPCommand`` setting
-in a :manual:`ctest(1)` dashboard client script.
+Legacy option. Not used.
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index 18bb452..8848bdd 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -177,9 +177,6 @@ if(BUILD_TESTING)
)
set(MEMORYCHECK_SUPPRESSIONS_FILE "" CACHE FILEPATH
"File that contains suppressions for the memory checker")
- find_program(SCPCOMMAND scp DOC
- "Path to scp command, used by CTest for submitting results to a Dart server"
- )
find_program(COVERAGE_COMMAND gcov DOC
"Path to the coverage program that CTest uses for performing coverage inspection"
)
diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in
index b86a5a9..735cadd 100644
--- a/Modules/DartConfiguration.tcl.in
+++ b/Modules/DartConfiguration.tcl.in
@@ -30,7 +30,6 @@ DropSitePassword: @DROP_SITE_PASSWORD@
DropSiteMode: @DROP_SITE_MODE@
DropMethod: @DROP_METHOD@
TriggerSite: @TRIGGER_SITE@
-ScpCommand: @SCPCOMMAND@
# Dashboard start time
NightlyStartTime: @NIGHTLY_START_TIME@
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index 60029ab..c1705d7 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -58,8 +58,6 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
this->CTest->SetCTestConfigurationFromCMakeVariable(
this->Makefile, "DropSitePassword", "CTEST_DROP_SITE_PASSWORD",
this->Quiet);
- this->CTest->SetCTestConfigurationFromCMakeVariable(
- this->Makefile, "ScpCommand", "CTEST_SCP_COMMAND", this->Quiet);
const char* notesFilesVariable =
this->Makefile->GetDefinition("CTEST_NOTES_FILES");
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index f457828..2232e38 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -5,9 +5,7 @@
#include "cm_curl.h"
#include "cm_jsoncpp_reader.h"
#include "cm_jsoncpp_value.h"
-#include "cmsys/Process.h"
#include <chrono>
-#include <cstring>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
@@ -20,10 +18,8 @@
#include "cmCurl.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
-#include "cmProcessOutput.h"
#include "cmState.h"
#include "cmSystemTools.h"
-#include "cmWorkingDirectory.h"
#include "cmXMLParser.h"
#include "cmake.h"
@@ -799,102 +795,6 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(
return true;
}
-bool cmCTestSubmitHandler::SubmitUsingSCP(
- const std::string& scp_command, const std::string& localprefix,
- const std::vector<std::string>& files, const std::string& remoteprefix,
- const std::string& url)
-{
- if (scp_command.empty() || localprefix.empty() || files.empty() ||
- remoteprefix.empty() || url.empty()) {
- return false;
- }
-
- std::vector<const char*> argv;
- argv.push_back(scp_command.c_str()); // Scp command
- argv.push_back(scp_command.c_str()); // Dummy string for file
- argv.push_back(scp_command.c_str()); // Dummy string for remote url
- argv.push_back(nullptr);
-
- cmsysProcess* cp = cmsysProcess_New();
- cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
- // cmsysProcess_SetTimeout(cp, timeout);
-
- int problems = 0;
-
- for (std::string const& file : files) {
- int retVal;
-
- std::string lfname = localprefix;
- cmSystemTools::ConvertToUnixSlashes(lfname);
- lfname += "/" + file;
- lfname = cmSystemTools::ConvertToOutputPath(lfname);
- argv[1] = lfname.c_str();
- std::string rfname = url + "/" + remoteprefix + file;
- argv[2] = rfname.c_str();
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Execute \"" << argv[0] << "\" \"" << argv[1] << "\" \""
- << argv[2] << "\"" << std::endl,
- this->Quiet);
- *this->LogFile << "Execute \"" << argv[0] << "\" \"" << argv[1] << "\" \""
- << argv[2] << "\"" << std::endl;
-
- cmsysProcess_SetCommand(cp, &*argv.begin());
- cmsysProcess_Execute(cp);
- char* data;
- int length;
- cmProcessOutput processOutput;
- std::string strdata;
-
- while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
- processOutput.DecodeText(data, length, strdata);
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- cmCTestLogWrite(strdata.c_str(), strdata.size()),
- this->Quiet);
- }
- processOutput.DecodeText(std::string(), strdata);
- if (!strdata.empty()) {
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- cmCTestLogWrite(strdata.c_str(), strdata.size()),
- this->Quiet);
- }
-
- cmsysProcess_WaitForExit(cp, nullptr);
-
- int result = cmsysProcess_GetState(cp);
-
- if (result == cmsysProcess_State_Exited) {
- retVal = cmsysProcess_GetExitValue(cp);
- if (retVal != 0) {
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "\tSCP returned: " << retVal << std::endl,
- this->Quiet);
- *this->LogFile << "\tSCP returned: " << retVal << std::endl;
- problems++;
- }
- } else if (result == cmsysProcess_State_Exception) {
- retVal = cmsysProcess_GetExitException(cp);
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "\tThere was an exception: " << retVal << std::endl);
- *this->LogFile << "\tThere was an exception: " << retVal << std::endl;
- problems++;
- } else if (result == cmsysProcess_State_Expired) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "\tThere was a timeout" << std::endl);
- *this->LogFile << "\tThere was a timeout" << std::endl;
- problems++;
- } else if (result == cmsysProcess_State_Error) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "\tError executing SCP: " << cmsysProcess_GetErrorString(cp)
- << std::endl);
- *this->LogFile << "\tError executing SCP: "
- << cmsysProcess_GetErrorString(cp) << std::endl;
- problems++;
- }
- }
- cmsysProcess_Delete(cp);
- return problems == 0;
-}
-
void cmCTestSubmitHandler::ConstructCDashURL(std::string& dropMethod,
std::string& url)
{
@@ -1447,39 +1347,6 @@ int cmCTestSubmitHandler::ProcessHandler()
}
return 0;
- } else if (dropMethod == "scp") {
- std::string url;
- if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty()) {
- url += this->CTest->GetCTestConfiguration("DropSiteUser") + "@";
- }
- url += this->CTest->GetCTestConfiguration("DropSite") + ":" +
- this->CTest->GetCTestConfiguration("DropLocation");
-
- // change to the build directory so that we can uses a relative path
- // on windows since scp doesn't support "c:" a drive in the path
- cmWorkingDirectory workdir(buildDirectory);
- if (workdir.Failed()) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Failed to change directory to "
- << buildDirectory << " : "
- << std::strerror(workdir.GetLastResult()) << std::endl);
- ofs << " Failed to change directory to " << buildDirectory << " : "
- << std::strerror(workdir.GetLastResult()) << std::endl;
- return -1;
- }
-
- if (!this->SubmitUsingSCP(this->CTest->GetCTestConfiguration("ScpCommand"),
- "Testing/" + this->CTest->GetCurrentTag(), files,
- prefix, url)) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Problems when submitting via SCP" << std::endl);
- ofs << " Problems when submitting via SCP" << std::endl;
- return -1;
- }
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Submission successful" << std::endl, this->Quiet);
- ofs << " Submission successful" << std::endl;
- return 0;
}
cmCTestLog(this->CTest, ERROR_MESSAGE,
diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h
index 5590561..5cbc9f6 100644
--- a/Source/CTest/cmCTestSubmitHandler.h
+++ b/Source/CTest/cmCTestSubmitHandler.h
@@ -63,10 +63,6 @@ private:
const std::vector<std::string>& files,
const std::string& remoteprefix,
const std::string& url);
- bool SubmitUsingSCP(const std::string& scp_command,
- const std::string& localprefix,
- const std::vector<std::string>& files,
- const std::string& remoteprefix, const std::string& url);
bool TriggerUsingHTTP(const std::vector<std::string>& files,
const std::string& remoteprefix,
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-scp-result.txt b/Tests/RunCMake/ctest_submit/FailDrop-scp-result.txt
deleted file mode 100644
index b57e2de..0000000
--- a/Tests/RunCMake/ctest_submit/FailDrop-scp-result.txt
+++ /dev/null
@@ -1 +0,0 @@
-(-1|255)
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-scp-stderr.txt b/Tests/RunCMake/ctest_submit/FailDrop-scp-stderr.txt
deleted file mode 100644
index ef67149..0000000
--- a/Tests/RunCMake/ctest_submit/FailDrop-scp-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
- Problems when submitting via SCP
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-scp-stdout.txt b/Tests/RunCMake/ctest_submit/FailDrop-scp-stdout.txt
deleted file mode 100644
index ec2ce92..0000000
--- a/Tests/RunCMake/ctest_submit/FailDrop-scp-stdout.txt
+++ /dev/null
@@ -1 +0,0 @@
-Submit files \(using scp\)
diff --git a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake
index b945ff6..097818c 100644
--- a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake
@@ -52,4 +52,3 @@ endfunction()
run_ctest_submit_FailDrop(ftp)
run_ctest_submit_FailDrop(http)
run_ctest_submit_FailDrop(https)
-run_ctest_submit_FailDrop(scp)