mirror of
https://github.com/reactos/CMake.git
synced 2025-02-02 01:55:03 +00:00
CTest: Remove submit method 'xmlrpc'
This commit is contained in:
parent
772edffbf0
commit
c2f6872c4e
@ -137,10 +137,6 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
|
||||
# Options have dependencies.
|
||||
include(CMakeDependentOption)
|
||||
|
||||
# Optionally use system xmlrpc. We no longer build or use it by default.
|
||||
option(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF)
|
||||
mark_as_advanced(CTEST_USE_XMLRPC)
|
||||
|
||||
# Allow the user to enable/disable all system utility library options by
|
||||
# defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}.
|
||||
set(UTILITIES BZIP2 CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA LIBRHASH LIBUV ZLIB)
|
||||
@ -171,10 +167,8 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
|
||||
|
||||
# Optionally use system utility libraries.
|
||||
option(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" "${CMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE}")
|
||||
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl"
|
||||
"${CMAKE_USE_SYSTEM_LIBRARY_CURL}" "NOT CTEST_USE_XMLRPC" ON)
|
||||
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat"
|
||||
"${CMAKE_USE_SYSTEM_LIBRARY_EXPAT}" "NOT CTEST_USE_XMLRPC" ON)
|
||||
option(CMAKE_USE_SYSTEM_CURL "Use system-installed curl" "${CMAKE_USE_SYSTEM_LIBRARY_CURL}")
|
||||
option(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat" "${CMAKE_USE_SYSTEM_LIBRARY_EXPAT}")
|
||||
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZLIB "Use system-installed zlib"
|
||||
"${CMAKE_USE_SYSTEM_LIBRARY_ZLIB}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE;NOT CMAKE_USE_SYSTEM_CURL" ON)
|
||||
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_BZIP2 "Use system-installed bzip2"
|
||||
@ -212,7 +206,7 @@ endmacro()
|
||||
macro(CMAKE_SETUP_TESTING)
|
||||
if(BUILD_TESTING)
|
||||
set(CMAKE_TEST_SYSTEM_LIBRARIES 0)
|
||||
foreach(util CURL EXPAT XMLRPC ZLIB)
|
||||
foreach(util CURL EXPAT ZLIB)
|
||||
if(CMAKE_USE_SYSTEM_${util})
|
||||
set(CMAKE_TEST_SYSTEM_LIBRARIES 1)
|
||||
endif()
|
||||
@ -571,18 +565,6 @@ macro (CMAKE_BUILD_UTILITIES)
|
||||
CMAKE_SET_TARGET_FOLDER(cmlibuv "Utilities/3rdParty")
|
||||
endif()
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Build XMLRPC library for CMake and CTest.
|
||||
if(CTEST_USE_XMLRPC)
|
||||
find_package(XMLRPC QUIET REQUIRED libwww-client)
|
||||
if(NOT XMLRPC_FOUND)
|
||||
message(FATAL_ERROR
|
||||
"CTEST_USE_XMLRPC is ON but xmlrpc is not found!")
|
||||
endif()
|
||||
set(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
|
||||
set(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
|
||||
endif()
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Use curses?
|
||||
if (UNIX)
|
||||
@ -736,7 +718,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
|
||||
# the build tree, which is both the build and the install RPATH.
|
||||
if (UNIX)
|
||||
if( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
|
||||
OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
|
||||
OR CMAKE_USE_SYSTEM_EXPAT OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
|
||||
set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
||||
|
@ -1107,8 +1107,7 @@ Configuration settings include:
|
||||
``DropMethod``
|
||||
Specify the method by which results should be submitted to the
|
||||
dashboard server. The value may be ``cp``, ``ftp``, ``http``,
|
||||
``https``, ``scp``, or ``xmlrpc`` (if CMake was built with
|
||||
support for it).
|
||||
``https``, or ``scp``.
|
||||
|
||||
* `CTest Script`_ variable: :variable:`CTEST_DROP_METHOD`
|
||||
* :module:`CTest` module variable: ``DROP_METHOD`` if set,
|
||||
@ -1116,7 +1115,7 @@ Configuration settings include:
|
||||
|
||||
``DropSite``
|
||||
The dashboard server name
|
||||
(for ``ftp``, ``http``, and ``https``, ``scp``, and ``xmlrpc``).
|
||||
(for ``ftp``, ``http``, and ``https``, ``scp``).
|
||||
|
||||
* `CTest Script`_ variable: :variable:`CTEST_DROP_SITE`
|
||||
* :module:`CTest` module variable: ``DROP_SITE`` if set,
|
||||
|
@ -813,7 +813,6 @@ target_compile_definitions(CMakeLib PUBLIC ${CLANG_TIDY_DEFINITIONS})
|
||||
#
|
||||
include_directories(
|
||||
"${CMake_SOURCE_DIR}/Source/CTest"
|
||||
${CMAKE_XMLRPC_INCLUDES}
|
||||
${CMAKE_CURL_INCLUDES}
|
||||
)
|
||||
#
|
||||
@ -879,7 +878,7 @@ set(CTEST_SRCS cmCTest.cxx
|
||||
|
||||
# Build CTestLib
|
||||
add_library(CTestLib ${CTEST_SRCS})
|
||||
target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES})
|
||||
target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES})
|
||||
|
||||
#
|
||||
# CPack
|
||||
|
@ -23,17 +23,10 @@
|
||||
#include "cmProcessOutput.h"
|
||||
#include "cmState.h"
|
||||
#include "cmSystemTools.h"
|
||||
#include "cmThirdParty.h"
|
||||
#include "cmWorkingDirectory.h"
|
||||
#include "cmXMLParser.h"
|
||||
#include "cmake.h"
|
||||
|
||||
#if defined(CTEST_USE_XMLRPC)
|
||||
# include "cmVersion.h"
|
||||
# include "cm_sys_stat.h"
|
||||
# include "cm_xmlrpc.h"
|
||||
#endif
|
||||
|
||||
#define SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT 120
|
||||
|
||||
typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
|
||||
@ -936,110 +929,6 @@ bool cmCTestSubmitHandler::SubmitUsingCP(const std::string& localprefix,
|
||||
return true;
|
||||
}
|
||||
|
||||
#if defined(CTEST_USE_XMLRPC)
|
||||
bool cmCTestSubmitHandler::SubmitUsingXMLRPC(
|
||||
const std::string& localprefix, const std::vector<std::string>& files,
|
||||
const std::string& remoteprefix, const std::string& url)
|
||||
{
|
||||
xmlrpc_env env;
|
||||
char ctestString[] = "CTest";
|
||||
std::string ctestVersionString = cmVersion::GetCMakeVersion();
|
||||
char* ctestVersion = const_cast<char*>(ctestVersionString.c_str());
|
||||
|
||||
std::string realURL = url + "/" + remoteprefix + "/Command/";
|
||||
|
||||
/* Start up our XML-RPC client library. */
|
||||
xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, ctestString, ctestVersion);
|
||||
|
||||
/* Initialize our error-handling environment. */
|
||||
xmlrpc_env_init(&env);
|
||||
|
||||
/* Call the famous server at UserLand. */
|
||||
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
|
||||
" Submitting to: " << realURL << " (" << remoteprefix
|
||||
<< ")" << std::endl,
|
||||
this->Quiet);
|
||||
for (std::string const& file : files) {
|
||||
xmlrpc_value* result;
|
||||
|
||||
std::string local_file = file;
|
||||
if (!cmSystemTools::FileExists(local_file)) {
|
||||
local_file = localprefix + "/" + file;
|
||||
}
|
||||
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
|
||||
" Submit file: " << local_file << std::endl,
|
||||
this->Quiet);
|
||||
struct stat st;
|
||||
if (::stat(local_file.c_str(), &st)) {
|
||||
cmCTestLog(this->CTest, ERROR_MESSAGE,
|
||||
" Cannot find file: " << local_file << std::endl);
|
||||
return false;
|
||||
}
|
||||
|
||||
// off_t can be bigger than size_t. fread takes size_t.
|
||||
// make sure the file is not too big.
|
||||
if (static_cast<off_t>(static_cast<size_t>(st.st_size)) !=
|
||||
static_cast<off_t>(st.st_size)) {
|
||||
cmCTestLog(this->CTest, ERROR_MESSAGE,
|
||||
" File too big: " << local_file << std::endl);
|
||||
return false;
|
||||
}
|
||||
size_t fileSize = static_cast<size_t>(st.st_size);
|
||||
FILE* fp = cmsys::SystemTools::Fopen(local_file, "rb");
|
||||
if (!fp) {
|
||||
cmCTestLog(this->CTest, ERROR_MESSAGE,
|
||||
" Cannot open file: " << local_file << std::endl);
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned char* fileBuffer = new unsigned char[fileSize];
|
||||
if (fread(fileBuffer, 1, fileSize, fp) != fileSize) {
|
||||
delete[] fileBuffer;
|
||||
fclose(fp);
|
||||
cmCTestLog(this->CTest, ERROR_MESSAGE,
|
||||
" Cannot read file: " << local_file << std::endl);
|
||||
return false;
|
||||
}
|
||||
fclose(fp);
|
||||
|
||||
char remoteCommand[] = "Submit.put";
|
||||
char* pRealURL = const_cast<char*>(realURL.c_str());
|
||||
result =
|
||||
xmlrpc_client_call(&env, pRealURL, remoteCommand, "(6)", fileBuffer,
|
||||
static_cast<xmlrpc_int32>(fileSize));
|
||||
|
||||
delete[] fileBuffer;
|
||||
|
||||
if (env.fault_occurred) {
|
||||
cmCTestLog(this->CTest, ERROR_MESSAGE,
|
||||
" Submission problem: " << env.fault_string << " ("
|
||||
<< env.fault_code << ")"
|
||||
<< std::endl);
|
||||
xmlrpc_env_clean(&env);
|
||||
xmlrpc_client_cleanup();
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Dispose of our result value. */
|
||||
xmlrpc_DECREF(result);
|
||||
}
|
||||
|
||||
/* Clean up our error-handling environment. */
|
||||
xmlrpc_env_clean(&env);
|
||||
|
||||
/* Shutdown our XML-RPC client library. */
|
||||
xmlrpc_client_cleanup();
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
bool cmCTestSubmitHandler::SubmitUsingXMLRPC(
|
||||
std::string const& /*unused*/, std::vector<std::string> const& /*unused*/,
|
||||
std::string const& /*unused*/, std::string const& /*unused*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
void cmCTestSubmitHandler::ConstructCDashURL(std::string& dropMethod,
|
||||
std::string& url)
|
||||
{
|
||||
@ -1592,32 +1481,6 @@ int cmCTestSubmitHandler::ProcessHandler()
|
||||
}
|
||||
|
||||
return 0;
|
||||
} else if (dropMethod == "xmlrpc") {
|
||||
#if defined(CTEST_USE_XMLRPC)
|
||||
ofs << "Using drop method: XML-RPC" << std::endl;
|
||||
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
|
||||
" Using XML-RPC submit method" << std::endl,
|
||||
this->Quiet);
|
||||
std::string url = this->CTest->GetCTestConfiguration("DropSite");
|
||||
prefix = this->CTest->GetCTestConfiguration("DropLocation");
|
||||
if (!this->SubmitUsingXMLRPC(buildDirectory + "/Testing/" +
|
||||
this->CTest->GetCurrentTag(),
|
||||
files, prefix, url)) {
|
||||
cmCTestLog(this->CTest, ERROR_MESSAGE,
|
||||
" Problems when submitting via XML-RPC" << std::endl);
|
||||
ofs << " Problems when submitting via XML-RPC" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
|
||||
" Submission successful" << std::endl, this->Quiet);
|
||||
ofs << " Submission successful" << std::endl;
|
||||
return 0;
|
||||
#else
|
||||
cmCTestLog(this->CTest, ERROR_MESSAGE,
|
||||
" Submission method \"xmlrpc\" not compiled into CTest!"
|
||||
<< std::endl);
|
||||
return -1;
|
||||
#endif
|
||||
} else if (dropMethod == "scp") {
|
||||
std::string url;
|
||||
if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty()) {
|
||||
|
@ -76,11 +76,6 @@ private:
|
||||
const std::string& remoteprefix,
|
||||
const std::string& url);
|
||||
|
||||
bool SubmitUsingXMLRPC(const std::string& localprefix,
|
||||
const std::vector<std::string>& files,
|
||||
const std::string& remoteprefix,
|
||||
const std::string& url);
|
||||
|
||||
typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
|
||||
|
||||
void ParseResponse(cmCTestSubmitHandlerVectorOfChar chunk);
|
||||
|
@ -2,8 +2,6 @@
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#include "cmCurl.h"
|
||||
|
||||
#include "cmThirdParty.h"
|
||||
|
||||
#if !defined(CMAKE_USE_SYSTEM_CURL) && !defined(_WIN32) && \
|
||||
!defined(__APPLE__) && !defined(CURL_CA_BUNDLE) && !defined(CURL_CA_PATH)
|
||||
# define CMAKE_FIND_CAFILE
|
||||
|
@ -1 +0,0 @@
|
||||
(-1|255)
|
@ -1 +0,0 @@
|
||||
(Problems when submitting via XML-RPC|Submission method "xmlrpc" not compiled into CTest!)
|
@ -1 +0,0 @@
|
||||
Submit files \(using xmlrpc\)
|
@ -54,4 +54,3 @@ run_ctest_submit_FailDrop(ftp)
|
||||
run_ctest_submit_FailDrop(http)
|
||||
run_ctest_submit_FailDrop(https)
|
||||
run_ctest_submit_FailDrop(scp)
|
||||
run_ctest_submit_FailDrop(xmlrpc)
|
||||
|
@ -97,9 +97,6 @@
|
||||
{ include: [ "@<uv-.+\\.h>", private, "\"cm_uv.h\"", public ] },
|
||||
{ include: [ "<kwiml/abi.h>", private, "\"cm_kwiml.h\"", public ] },
|
||||
{ include: [ "<kwiml/int.h>", private, "\"cm_kwiml.h\"", public ] },
|
||||
{ include: [ "<xmlrpc.h>", private, "\"cm_xmlrpc.h\"", public ] },
|
||||
{ include: [ "<xmlrpc_client.h>", private, "\"cm_xmlrpc.h\"", public ] },
|
||||
{ include: [ "@<xmlrpc-c/.+\\.h>", private, "\"cm_xmlrpc.h\"", public ] },
|
||||
{ include: [ "<zconf.h>", private, "\"cm_zlib.h\"", public ] },
|
||||
{ include: [ "<zlib.h>", private, "\"cm_zlib.h\"", public ] },
|
||||
|
||||
|
@ -15,6 +15,5 @@
|
||||
#cmakedefine CMAKE_USE_SYSTEM_JSONCPP
|
||||
#cmakedefine CMAKE_USE_SYSTEM_LIBRHASH
|
||||
#cmakedefine CMAKE_USE_SYSTEM_LIBUV
|
||||
#cmakedefine CTEST_USE_XMLRPC
|
||||
|
||||
#endif
|
||||
|
@ -1,13 +0,0 @@
|
||||
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#ifndef cm_xmlrpc_h
|
||||
#define cm_xmlrpc_h
|
||||
|
||||
/* Use the xmlrpc library configured for CMake. */
|
||||
#include "cmThirdParty.h"
|
||||
#ifdef CTEST_USE_XMLRPC
|
||||
# include <xmlrpc.h>
|
||||
# include <xmlrpc_client.h>
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user