\class cmTest * \brief Represent a test * * cmTest is representation of a test. */
| 21 | * cmTest is representation of a test. |
| 22 | */ |
| 23 | class cmTest |
| 24 | { |
| 25 | public: |
| 26 | /** |
| 27 | */ |
| 28 | cmTest(cmMakefile* mf); |
| 29 | ~cmTest(); |
| 30 | |
| 31 | //! Set the test name |
| 32 | void SetName(std::string const& name); |
| 33 | std::string GetName() const { return this->Name; } |
| 34 | |
| 35 | void SetCommand(std::vector<std::string> const& command); |
| 36 | std::vector<std::string> const& GetCommand() const { return this->Command; } |
| 37 | |
| 38 | //! Set/Get a property of this source file |
| 39 | void SetProperty(std::string const& prop, cmValue value); |
| 40 | void SetProperty(std::string const& prop, std::nullptr_t) |
| 41 | { |
| 42 | this->SetProperty(prop, cmValue{ nullptr }); |
| 43 | } |
| 44 | void SetProperty(std::string const& prop, std::string const& value) |
| 45 | { |
| 46 | this->SetProperty(prop, cmValue(value)); |
| 47 | } |
| 48 | void AppendProperty(std::string const& prop, std::string const& value, |
| 49 | bool asString = false); |
| 50 | cmValue GetProperty(std::string const& prop) const; |
| 51 | bool GetPropertyAsBool(std::string const& prop) const; |
| 52 | cmPropertyMap& GetProperties() { return this->Properties; } |
| 53 | |
| 54 | /** Get the cmMakefile instance that owns this test. */ |
| 55 | cmMakefile* GetMakefile() { return this->Makefile; } |
| 56 | |
| 57 | /** Get the backtrace of the command that created this test. */ |
| 58 | cmListFileBacktrace const& GetBacktrace() const; |
| 59 | |
| 60 | /** Get/Set whether this is an old-style test. */ |
| 61 | bool GetOldStyle() const { return this->OldStyle; } |
| 62 | void SetOldStyle(bool b) { this->OldStyle = b; } |
| 63 | |
| 64 | /** Get if CMP0158 policy is NEW */ |
| 65 | bool GetCMP0158IsNew() const |
| 66 | { |
| 67 | return this->PolicyStatusCMP0158 == cmPolicies::NEW; |
| 68 | } |
| 69 | |
| 70 | /** Get/Set the CMP0178 policy setting */ |
| 71 | cmPolicies::PolicyStatus GetCMP0178() const |
| 72 | { |
| 73 | return this->PolicyStatusCMP0178; |
| 74 | } |
| 75 | void SetCMP0178(cmPolicies::PolicyStatus p) |
| 76 | { |
| 77 | this->PolicyStatusCMP0178 = p; |
| 78 | } |
| 79 | |
| 80 | /** Set/Get whether lists in command lines should be expanded. */ |
no outgoing calls
searching dependent graphs…