https://github.com/Kitware/CMake
Tip revision: aa6a33fe54918967f6ffcad30773e01664e8a2b2 authored by Brad King on 07 December 2021, 15:44:21 UTC
CMake 3.22.1
CMake 3.22.1
Tip revision: aa6a33f
cmCTestUploadCommand.cxx
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCTestUploadCommand.h"
#include <set>
#include <sstream>
#include <cm/vector>
#include <cmext/string_view>
#include "cmCTest.h"
#include "cmCTestUploadHandler.h"
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmSystemTools.h"
void cmCTestUploadCommand::BindArguments()
{
this->Bind("FILES"_s, this->Files);
this->Bind("QUIET"_s, this->Quiet);
this->Bind("CAPTURE_CMAKE_ERROR"_s, this->CaptureCMakeError);
}
void cmCTestUploadCommand::CheckArguments(std::vector<std::string> const&)
{
cm::erase_if(this->Files, [this](std::string const& arg) -> bool {
if (!cmSystemTools::FileExists(arg)) {
std::ostringstream e;
e << "File \"" << arg << "\" does not exist. Cannot submit "
<< "a non-existent file.";
this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return true;
}
return false;
});
}
cmCTestGenericHandler* cmCTestUploadCommand::InitializeHandler()
{
cmCTestUploadHandler* handler = this->CTest->GetUploadHandler();
handler->Initialize();
handler->SetFiles(
std::set<std::string>(this->Files.begin(), this->Files.end()));
handler->SetQuiet(this->Quiet);
return handler;
}