2005-04-24 23:59:51 +04:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
|
|
|
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
|
|
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
PURPOSE. See the above copyright notices for more information.
|
|
|
|
|
|
|
|
=========================================================================*/
|
|
|
|
#ifndef cmTest_h
|
|
|
|
#define cmTest_h
|
|
|
|
|
|
|
|
#include "cmCustomCommand.h"
|
2006-12-07 17:45:32 +03:00
|
|
|
#include "cmPropertyMap.h"
|
|
|
|
class cmMakefile;
|
2009-08-11 17:07:28 +04:00
|
|
|
class cmListFileBacktrace;
|
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
|
|
|
|
void SetName(const char* name);
|
2006-03-15 19:02:08 +03:00
|
|
|
const char* GetName() const { return this->Name.c_str(); }
|
2009-03-16 17:42:40 +03:00
|
|
|
|
|
|
|
void SetCommand(std::vector<std::string> const& command);
|
|
|
|
std::vector<std::string> const& GetCommand() const
|
2005-04-24 23:59:51 +04:00
|
|
|
{
|
2009-03-16 17:42:40 +03:00
|
|
|
return this->Command;
|
2005-04-24 23:59:51 +04: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);
|
2008-01-18 02:13:55 +03:00
|
|
|
void AppendProperty(const char* prop, const char* value);
|
2005-04-24 23:59:51 +04:00
|
|
|
const char *GetProperty(const char *prop) const;
|
|
|
|
bool GetPropertyAsBool(const char *prop) const;
|
2006-12-07 17:45:32 +03:00
|
|
|
cmPropertyMap &GetProperties() { return this->Properties; };
|
2005-04-24 23:59:51 +04:00
|
|
|
|
2006-12-07 17:45:32 +03:00
|
|
|
// Define the properties
|
|
|
|
static void DefineProperties(cmake *cm);
|
|
|
|
|
2009-08-11 17:07:28 +04:00
|
|
|
/** Get the cmMakefile instance that owns this test. */
|
2006-12-07 17:45:32 +03:00
|
|
|
cmMakefile *GetMakefile() { return this->Makefile;};
|
|
|
|
|
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;
|
2006-03-15 19:02:08 +03:00
|
|
|
cmStdString 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;
|
|
|
|
cmListFileBacktrace* Backtrace;
|
2005-04-24 23:59:51 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|