2009-09-28 15:43:28 +00:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2005-04-24 19:59:51 +00:00
|
|
|
|
2009-09-28 15:43:28 +00:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2005-04-24 19:59:51 +00:00
|
|
|
|
2009-09-28 15:43:28 +00:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
2005-04-24 19:59:51 +00:00
|
|
|
#ifndef cmTest_h
|
|
|
|
#define cmTest_h
|
|
|
|
|
|
|
|
#include "cmCustomCommand.h"
|
2006-12-07 14:45:32 +00:00
|
|
|
#include "cmPropertyMap.h"
|
|
|
|
class cmMakefile;
|
2009-08-11 13:07:28 +00:00
|
|
|
class cmListFileBacktrace;
|
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();
|
|
|
|
|
|
|
|
///! Set the test name
|
|
|
|
void SetName(const char* name);
|
2006-03-15 16:02:08 +00:00
|
|
|
const char* GetName() const { return this->Name.c_str(); }
|
2009-03-16 14:42:40 +00:00
|
|
|
|
|
|
|
void SetCommand(std::vector<std::string> const& command);
|
|
|
|
std::vector<std::string> const& GetCommand() const
|
2005-04-24 19:59:51 +00:00
|
|
|
{
|
2009-03-16 14:42:40 +00:00
|
|
|
return this->Command;
|
2005-04-24 19:59:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Print the structure to std::cout.
|
|
|
|
*/
|
|
|
|
void Print() const;
|
|
|
|
|
|
|
|
///! Set/Get a property of this source file
|
|
|
|
void SetProperty(const char *prop, const char *value);
|
2011-07-13 21:14:41 +00:00
|
|
|
void AppendProperty(const char* prop, const char* value,bool asString=false);
|
2005-04-24 19:59:51 +00:00
|
|
|
const char *GetProperty(const char *prop) const;
|
|
|
|
bool GetPropertyAsBool(const char *prop) const;
|
2006-12-07 14:45:32 +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. */
|
2006-12-07 14:45:32 +00:00
|
|
|
cmMakefile *GetMakefile() { return this->Makefile;};
|
|
|
|
|
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; }
|
|
|
|
|
2005-04-24 19:59:51 +00:00
|
|
|
private:
|
2006-12-07 14:45:32 +00:00
|
|
|
cmPropertyMap Properties;
|
2006-03-15 16:02:08 +00:00
|
|
|
cmStdString Name;
|
2009-03-16 14:42:40 +00:00
|
|
|
std::vector<std::string> Command;
|
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;
|
|
|
|
cmListFileBacktrace* Backtrace;
|
2005-04-24 19:59:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|