2016-09-27 22:01:08 +03: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 23:59:51 +04:00
|
|
|
#ifndef cmTest_h
|
|
|
|
#define cmTest_h
|
|
|
|
|
2016-08-17 02:08:13 +03:00
|
|
|
#include <cmConfigure.h> // IWYU pragma: keep
|
2016-04-29 16:40:20 +03:00
|
|
|
|
2014-05-23 22:59:11 +04:00
|
|
|
#include "cmListFileCache.h"
|
2016-04-29 17:53:13 +03:00
|
|
|
#include "cmPropertyMap.h"
|
2016-08-17 02:08:13 +03:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2006-12-07 17:45:32 +03:00
|
|
|
class cmMakefile;
|
2005-04-24 23:59:51 +04:00
|
|
|
|
|
|
|
/** \class cmTest
|
|
|
|
* \brief Represent a test
|
|
|
|
*
|
|
|
|
* cmTest is representation of a test.
|
|
|
|
*/
|
|
|
|
class cmTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
*/
|
2009-08-11 17:07:28 +04:00
|
|
|
cmTest(cmMakefile* mf);
|
2005-04-24 23:59:51 +04:00
|
|
|
~cmTest();
|
|
|
|
|
|
|
|
///! Set the test name
|
2014-02-04 06:20:33 +04:00
|
|
|
void SetName(const std::string& name);
|
|
|
|
std::string GetName() const { return this->Name; }
|
2009-03-16 17:42:40 +03:00
|
|
|
|
|
|
|
void SetCommand(std::vector<std::string> const& command);
|
2016-05-16 17:34:04 +03:00
|
|
|
std::vector<std::string> const& GetCommand() const { return this->Command; }
|
2005-04-24 23:59:51 +04:00
|
|
|
|
|
|
|
///! Set/Get a property of this source file
|
2016-05-16 17:34:04 +03: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-03 00:27:32 +04:00
|
|
|
bool GetPropertyAsBool(const std::string& prop) const;
|
2016-05-16 17:34:04 +03:00
|
|
|
cmPropertyMap& GetProperties() { return this->Properties; }
|
2012-08-13 21:42:58 +04:00
|
|
|
|
2009-08-11 17:07:28 +04:00
|
|
|
/** Get the cmMakefile instance that owns this test. */
|
2016-05-16 17:34:04 +03:00
|
|
|
cmMakefile* GetMakefile() { return this->Makefile; }
|
2006-12-07 17:45:32 +03:00
|
|
|
|
2009-08-11 17:07:28 +04:00
|
|
|
/** Get the backtrace of the command that created this test. */
|
|
|
|
cmListFileBacktrace const& GetBacktrace() const;
|
|
|
|
|
2009-03-16 17:51:30 +03:00
|
|
|
/** Get/Set whether this is an old-style test. */
|
|
|
|
bool GetOldStyle() const { return this->OldStyle; }
|
|
|
|
void SetOldStyle(bool b) { this->OldStyle = b; }
|
|
|
|
|
2005-04-24 23:59:51 +04:00
|
|
|
private:
|
2006-12-07 17:45:32 +03:00
|
|
|
cmPropertyMap Properties;
|
2014-02-10 09:21:34 +04:00
|
|
|
std::string Name;
|
2009-03-16 17:42:40 +03:00
|
|
|
std::vector<std::string> Command;
|
2006-12-07 17:45:32 +03:00
|
|
|
|
2009-03-16 17:51:30 +03:00
|
|
|
bool OldStyle;
|
|
|
|
|
2009-08-11 17:07:28 +04:00
|
|
|
cmMakefile* Makefile;
|
2014-05-23 22:59:11 +04:00
|
|
|
cmListFileBacktrace Backtrace;
|
2005-04-24 23:59:51 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|