cmake/Source/cmTestGenerator.h

58 lines
1.7 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
2009-10-04 10:30:41 +03:00
2018-01-26 17:06:56 +01:00
#include "cmConfigure.h" // IWYU pragma: keep
2016-10-30 18:24:19 +01:00
#include <iosfwd>
#include <string>
#include <vector>
2020-02-01 23:06:01 +01:00
#include "cmScriptGenerator.h"
class cmGeneratorExpression;
2015-11-17 17:22:37 +01:00
class cmLocalGenerator;
2016-10-30 18:24:19 +01:00
class cmTest;
2009-10-04 10:30:41 +03:00
/** \class cmTestGenerator
* \brief Support class for generating install scripts.
*
*/
2016-07-09 11:21:54 +02:00
class cmTestGenerator : public cmScriptGenerator
2009-10-04 10:30:41 +03:00
{
public:
cmTestGenerator(cmTest* test,
2016-07-09 11:21:54 +02:00
std::vector<std::string> const& configurations =
std::vector<std::string>());
2018-01-26 17:06:56 +01:00
~cmTestGenerator() override;
2009-10-04 10:30:41 +03:00
2019-11-11 23:01:05 +01:00
cmTestGenerator(cmTestGenerator const&) = delete;
cmTestGenerator& operator=(cmTestGenerator const&) = delete;
2015-11-17 17:22:37 +01:00
void Compute(cmLocalGenerator* lg);
2018-04-23 21:13:27 +02:00
/** Test if this generator installs the test for a given configuration. */
bool TestsForConfig(const std::string& config);
cmTest* GetTest() const;
2019-11-11 23:01:05 +01:00
private:
void GenerateInternalProperties(std::ostream& os);
2020-02-01 23:06:01 +01:00
std::vector<std::string> EvaluateCommandLineArguments(
const std::vector<std::string>& argv, cmGeneratorExpression& ge,
const std::string& config) const;
2019-11-11 23:01:05 +01:00
2009-10-04 10:30:41 +03:00
protected:
2018-01-26 17:06:56 +01:00
void GenerateScriptConfigs(std::ostream& os, Indent indent) override;
void GenerateScriptActions(std::ostream& os, Indent indent) override;
2016-10-30 18:24:19 +01:00
void GenerateScriptForConfig(std::ostream& os, const std::string& config,
2018-01-26 17:06:56 +01:00
Indent indent) override;
void GenerateScriptNoConfig(std::ostream& os, Indent indent) override;
bool NeedsScriptNoConfig() const override;
2017-07-20 19:35:53 +02:00
void GenerateOldStyle(std::ostream& os, Indent indent);
2009-10-04 10:30:41 +03:00
2015-11-17 17:22:37 +01:00
cmLocalGenerator* LG;
2009-10-04 10:30:41 +03:00
cmTest* Test;
bool TestGenerated;
};