summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-01-12 15:37:25 (GMT)
committerBrad King <brad.king@kitware.com>2009-01-12 15:37:25 (GMT)
commit4b97fab34d07afe05b057dbb6b2c64f4f0d24f40 (patch)
treef2d4dfbebf69604eacf594b6bf01b5fde7f53aa4 /Source/cmCTest.h
parentcccac773cea0d724474a441a2e205cdb2d7193de (diff)
downloadCMake-4b97fab34d07afe05b057dbb6b2c64f4f0d24f40.zip
CMake-4b97fab34d07afe05b057dbb6b2c64f4f0d24f40.tar.gz
CMake-4b97fab34d07afe05b057dbb6b2c64f4f0d24f40.tar.bz2
ENH: Refactor cmCTest test part representation
This introduces the name "part" to denote a portion of the testing and submission process performed by ctest. We generalize the boolean indicating whether each part is enabled into a structure to which more information can be added later. We provide bi-directional mapping between part id and part names.
Diffstat (limited to 'Source/cmCTest.h')
-rw-r--r--Source/cmCTest.h53
1 files changed, 37 insertions, 16 deletions
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index edce0c4..f3cdaab 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -50,6 +50,40 @@ class cmCTestScriptHandler;
class cmCTest
{
public:
+ /** Enumerate parts of the testing and submission process. */
+ enum Part
+ {
+ PartStart,
+ PartUpdate,
+ PartConfigure,
+ PartBuild,
+ PartTest,
+ PartCoverage,
+ PartMemCheck,
+ PartSubmit,
+ PartNotes,
+ PartCount // Update names in constructor when adding a part
+ };
+
+ /** Representation of one part. */
+ struct PartInfo
+ {
+ PartInfo(): Enabled(false) {}
+
+ void SetName(const char* name) { this->Name = name; }
+ const char* GetName() const { return this->Name.c_str(); }
+
+ void Enable() { this->Enabled = true; }
+ operator bool() const { return this->Enabled; }
+ private:
+ bool Enabled;
+ std::string Name;
+ };
+
+ /** Get a testing part id from its string name. Returns PartCount
+ if the string does not name a valid part. */
+ Part GetPartFromName(const char* name);
+
typedef std::vector<cmStdString> VectorOfStrings;
typedef std::set<cmStdString> SetOfStrings;
@@ -356,28 +390,15 @@ private:
bool ShowOnly;
- enum {
- FIRST_TEST = 0,
- UPDATE_TEST = 1,
- START_TEST = 2,
- CONFIGURE_TEST = 3,
- BUILD_TEST = 4,
- TEST_TEST = 5,
- COVERAGE_TEST = 6,
- MEMCHECK_TEST = 7,
- SUBMIT_TEST = 8,
- NOTES_TEST = 9,
- ALL_TEST = 10,
- LAST_TEST = 11
- };
-
//! Map of configuration properties
typedef std::map<cmStdString, cmStdString> CTestConfigurationMap;
std::string CTestConfigFile;
CTestConfigurationMap CTestConfiguration;
CTestConfigurationMap CTestConfigurationOverwrites;
- int Tests[LAST_TEST];
+ PartInfo Parts[PartCount];
+ typedef std::map<cmStdString, Part> PartMapType;
+ PartMapType PartMap;
std::string CurrentTag;
bool TomorrowTag;