2016-09-27 19:01:08 +00:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
2005-04-24 19:59:51 +00:00
|
|
|
#ifndef cmTest_h
|
|
|
|
#define cmTest_h
|
|
|
|
|
2017-04-11 20:00:21 +00:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2016-04-29 13:40:20 +00:00
|
|
|
|
2014-05-23 18:59:11 +00:00
|
|
|
#include "cmListFileCache.h"
|
2016-04-29 14:53:13 +00:00
|
|
|
#include "cmPropertyMap.h"
|
2016-08-16 23:08:13 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2006-12-07 14:45:32 +00:00
|
|
|
class cmMakefile;
|
2005-04-24 19:59:51 +00:00
|
|
|
|
|
|
|
/** \class cmTest
|
|
|
|
* \brief Represent a test
|
|
|
|
*
|
|
|
|
* cmTest is representation of a test.
|
|
|
|
*/
|
|
|
|
class cmTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
*/
|
2009-08-11 13:07:28 +00:00
|
|
|
cmTest(cmMakefile* mf);
|
2005-04-24 19:59:51 +00:00
|
|
|
~cmTest();
|
|
|
|
|
2019-03-31 09:27:12 +00:00
|
|
|
//! Set the test name
|
2014-02-04 02:20:33 +00:00
|
|
|
void SetName(const std::string& name);
|
|
|
|
std::string GetName() const { return this->Name; }
|
2009-03-16 14:42:40 +00:00
|
|
|
|
|
|
|
void SetCommand(std::vector<std::string> const& command);
|
2016-05-16 14:34:04 +00:00
|
|
|
std::vector<std::string> const& GetCommand() const { return this->Command; }
|
2005-04-24 19:59:51 +00:00
|
|
|
|
2019-03-31 09:27:12 +00:00
|
|
|
//! Set/Get a property of this source file
|
2016-05-16 14:34:04 +00:00
|
|
|
void SetProperty(const std::string& prop, const char* value);
|
|
|
|
void AppendProperty(const std::string& prop, const char* value,
|
|
|
|
bool asString = false);
|
|
|
|
const char* GetProperty(const std::string& prop) const;
|
2013-09-02 20:27:32 +00:00
|
|
|
bool GetPropertyAsBool(const std::string& prop) const;
|
2016-05-16 14:34:04 +00:00
|
|
|
cmPropertyMap& GetProperties() { return this->Properties; }
|
2012-08-13 17:42:58 +00:00
|
|
|
|
2009-08-11 13:07:28 +00:00
|
|
|
/** Get the cmMakefile instance that owns this test. */
|
2016-05-16 14:34:04 +00:00
|
|
|
cmMakefile* GetMakefile() { return this->Makefile; }
|
2006-12-07 14:45:32 +00:00
|
|
|
|
2009-08-11 13:07:28 +00:00
|
|
|
/** Get the backtrace of the command that created this test. */
|
|
|
|
cmListFileBacktrace const& GetBacktrace() const;
|
|
|
|
|
2009-03-16 14:51:30 +00:00
|
|
|
/** Get/Set whether this is an old-style test. */
|
|
|
|
bool GetOldStyle() const { return this->OldStyle; }
|
|
|
|
void SetOldStyle(bool b) { this->OldStyle = b; }
|
|
|
|
|
2019-05-15 15:10:39 +00:00
|
|
|
/** Set/Get whether lists in command lines should be expanded. */
|
|
|
|
bool GetCommandExpandLists() const;
|
|
|
|
void SetCommandExpandLists(bool b);
|
|
|
|
|
2005-04-24 19:59:51 +00:00
|
|
|
private:
|
2006-12-07 14:45:32 +00:00
|
|
|
cmPropertyMap Properties;
|
2014-02-10 05:21:34 +00:00
|
|
|
std::string Name;
|
2009-03-16 14:42:40 +00:00
|
|
|
std::vector<std::string> Command;
|
2019-05-15 15:10:39 +00:00
|
|
|
bool CommandExpandLists;
|
2006-12-07 14:45:32 +00:00
|
|
|
|
2009-03-16 14:51:30 +00:00
|
|
|
bool OldStyle;
|
|
|
|
|
2009-08-11 13:07:28 +00:00
|
|
|
cmMakefile* Makefile;
|
2014-05-23 18:59:11 +00:00
|
|
|
cmListFileBacktrace Backtrace;
|
2005-04-24 19:59:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|