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 "cmConfigure.h" // IWYU pragma: keep
10 #include "cmListFileCache.h"
11 #include "cmPropertyMap.h"
17 * \brief Represent a test
19 * cmTest is representation of a test.
26 cmTest(cmMakefile* mf);
30 void SetName(const std::string& name);
31 std::string GetName() const { return this->Name; }
33 void SetCommand(std::vector<std::string> const& command);
34 std::vector<std::string> const& GetCommand() const { return this->Command; }
36 //! Set/Get a property of this source file
37 void SetProperty(const std::string& prop, const char* value);
38 void SetProperty(const std::string& prop, cmValue value);
39 void SetProperty(const std::string& prop, const std::string& value)
41 this->SetProperty(prop, cmValue(value));
43 void AppendProperty(const std::string& prop, const std::string& value,
44 bool asString = false);
45 cmValue GetProperty(const std::string& prop) const;
46 bool GetPropertyAsBool(const std::string& prop) const;
47 cmPropertyMap& GetProperties() { return this->Properties; }
49 /** Get the cmMakefile instance that owns this test. */
50 cmMakefile* GetMakefile() { return this->Makefile; }
52 /** Get the backtrace of the command that created this test. */
53 cmListFileBacktrace const& GetBacktrace() const;
55 /** Get/Set whether this is an old-style test. */
56 bool GetOldStyle() const { return this->OldStyle; }
57 void SetOldStyle(bool b) { this->OldStyle = b; }
59 /** Set/Get whether lists in command lines should be expanded. */
60 bool GetCommandExpandLists() const;
61 void SetCommandExpandLists(bool b);
64 cmPropertyMap Properties;
66 std::vector<std::string> Command;
67 bool CommandExpandLists = false;
72 cmListFileBacktrace Backtrace;