1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
5 #include "cmMakefile.h"
6 #include "cmProperty.h"
10 cmTest::cmTest(cmMakefile* mf)
11 : Backtrace(mf->GetBacktrace())
14 this->OldStyle = true;
17 cmTest::~cmTest() = default;
19 cmListFileBacktrace const& cmTest::GetBacktrace() const
21 return this->Backtrace;
24 void cmTest::SetName(const std::string& name)
29 void cmTest::SetCommand(std::vector<std::string> const& command)
31 this->Command = command;
34 cmValue cmTest::GetProperty(const std::string& prop) const
36 cmValue retVal = this->Properties.GetPropertyValue(prop);
39 this->Makefile->GetState()->IsPropertyChained(prop, cmProperty::TEST);
41 if (cmValue p = this->Makefile->GetProperty(prop, chain)) {
50 bool cmTest::GetPropertyAsBool(const std::string& prop) const
52 return cmIsOn(this->GetProperty(prop));
55 void cmTest::SetProperty(const std::string& prop, const char* value)
57 this->Properties.SetProperty(prop, value);
59 void cmTest::SetProperty(const std::string& prop, cmValue value)
61 this->Properties.SetProperty(prop, value);
64 void cmTest::AppendProperty(const std::string& prop, const std::string& value,
67 this->Properties.AppendProperty(prop, value, asString);
70 bool cmTest::GetCommandExpandLists() const
72 return this->CommandExpandLists;
75 void cmTest::SetCommandExpandLists(bool b)
77 this->CommandExpandLists = b;