summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorSebastien Barre <sebastien.barre@kitware.com>2002-03-06 22:58:44 (GMT)
committerSebastien Barre <sebastien.barre@kitware.com>2002-03-06 22:58:44 (GMT)
commite64c63cc90e9875f41357174973a3930de470815 (patch)
tree4028a78137d1e1ce443daf88d0c0bbb17a2fcb7f /Source
parent3ed2e6d02b53c80062b464b48e0dd51370f2e1c0 (diff)
downloadCMake-e64c63cc90e9875f41357174973a3930de470815.zip
CMake-e64c63cc90e9875f41357174973a3930de470815.tar.gz
CMake-e64c63cc90e9875f41357174973a3930de470815.tar.bz2
ENH: add -E option (exclude tests matching a regexp)
Diffstat (limited to 'Source')
-rw-r--r--Source/ctest.cxx28
-rw-r--r--Source/ctest.h15
2 files changed, 36 insertions, 7 deletions
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index 43a9f66..e9a8e0f 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -134,7 +134,8 @@ void ctest::ProcessDirectory(int &passed, std::vector<std::string> &failed)
std::string name;
std::vector<std::string> args;
- cmRegularExpression var(this->m_RegExp.c_str());
+ cmRegularExpression ireg(this->m_IncludeRegExp.c_str());
+ cmRegularExpression ereg(this->m_ExcludeRegExp.c_str());
cmRegularExpression dartStuff("([\t\n ]*<DartMeasurement.*/DartMeasurement[a-zA-Z]*>[\t ]*[\n]*)");
bool parseError;
@@ -164,7 +165,19 @@ void ctest::ProcessDirectory(int &passed, std::vector<std::string> &failed)
if (name == "ADD_TEST")
{
- if (this->m_UseRegExp && !var.find(args[0].c_str()))
+ if (this->m_UseExcludeRegExp &&
+ this->m_UseExcludeRegExpFirst &&
+ ereg.find(args[0].c_str()))
+ {
+ continue;
+ }
+ if (this->m_UseIncludeRegExp && !ireg.find(args[0].c_str()))
+ {
+ continue;
+ }
+ if (this->m_UseExcludeRegExp &&
+ !this->m_UseExcludeRegExpFirst &&
+ ereg.find(args[0].c_str()))
{
continue;
}
@@ -265,8 +278,15 @@ int main (int argc, char *argv[])
if(arg.find("-R",0) == 0 && i < args.size() - 1)
{
- inst.m_UseRegExp = true;
- inst.m_RegExp = args[i+1];
+ inst.m_UseIncludeRegExp = true;
+ inst.m_IncludeRegExp = args[i+1];
+ }
+
+ if(arg.find("-E",0) == 0 && i < args.size() - 1)
+ {
+ inst.m_UseExcludeRegExp = true;
+ inst.m_ExcludeRegExp = args[i+1];
+ inst.m_UseExcludeRegExpFirst = inst.m_UseIncludeRegExp ? false : true;
}
}
diff --git a/Source/ctest.h b/Source/ctest.h
index eef6b28..60065a1 100644
--- a/Source/ctest.h
+++ b/Source/ctest.h
@@ -36,10 +36,19 @@ public:
/**
* constructor
*/
- ctest() {m_UseRegExp = false;}
+ ctest() {
+ m_UseIncludeRegExp = false;
+ m_UseExcludeRegExp = false;
+ m_UseExcludeRegExpFirst = false;
+ }
+
+ bool m_UseIncludeRegExp;
+ std::string m_IncludeRegExp;
+
+ bool m_UseExcludeRegExp;
+ bool m_UseExcludeRegExpFirst;
+ std::string m_ExcludeRegExp;
- bool m_UseRegExp;
- std::string m_RegExp;
std::string m_ConfigType;
private:
};