cmake/Source/CTest/cmCTestUpdateHandler.h

65 lines
1.2 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2021-09-14 00:13:48 +02:00
#pragma once
2018-01-26 17:06:56 +01:00
#include "cmConfigure.h" // IWYU pragma: keep
2016-10-30 18:24:19 +01:00
#include <string>
#include <utility>
#include <vector>
2020-02-01 23:06:01 +01:00
#include "cmCTestGenericHandler.h"
/** \class cmCTestUpdateHandler
* \brief A class that handles ctest -S invocations
*
*/
class cmCTestUpdateHandler : public cmCTestGenericHandler
{
public:
2020-02-01 23:06:01 +01:00
using Superclass = cmCTestGenericHandler;
/*
* The main entry point for this class
*/
2018-01-26 17:06:56 +01:00
int ProcessHandler() override;
cmCTestUpdateHandler();
2016-07-09 11:21:54 +02:00
enum
{
e_UNKNOWN = 0,
e_CVS,
e_SVN,
2009-10-04 10:30:41 +03:00
e_BZR,
e_GIT,
e_HG,
2014-08-03 19:52:23 +02:00
e_P4,
e_LAST
};
/**
* Initialize handler
*/
2018-01-26 17:06:56 +01:00
void Initialize() override;
private:
// Some structures needed for update
2016-07-09 11:21:54 +02:00
struct StringPair : public std::pair<std::string, std::string>
{
};
struct UpdateFiles : public std::vector<StringPair>
{
};
// Determine the type of version control
int DetermineType(const char* cmd, const char* type);
2009-10-04 10:30:41 +03:00
// The VCS command to update the working tree.
std::string UpdateCommand;
int UpdateType;
int DetectVCS(const char* dir);
bool SelectVCS();
};