Revision: 3703
Author: janne.t.harkonen
Date: Wed Jun  2 00:43:18 2010
Log: remove directories that do not contain any tests from model
http://code.google.com/p/robotframework/source/detail?r=3703

Modified:
 /trunk/src/robot/parsing/model.py

=======================================
--- /trunk/src/robot/parsing/model.py   Tue Jun  1 03:02:26 2010
+++ /trunk/src/robot/parsing/model.py   Wed Jun  2 00:43:18 2010
@@ -110,6 +110,9 @@
     def _valid_table(self, table):
         return table

+    def has_tests(self):
+        return True
+
     def __iter__(self):
         for table in [self.setting_table, self.variable_table,
                       self.testcase_table, self.keyword_table]:
@@ -159,6 +162,7 @@
         self.keyword_table = KeywordTable(self)
         if self.source:
FromDirectoryPopulator().populate(self.source, self, include_suites) + self.children = [ ch for ch in self.children if ch.has_tests() ]

     def _valid_table(self, table):
         if table is self.testcase_table:
@@ -170,6 +174,9 @@
         self.children.append(TestData(parent=self,source=path,
                                       include_suites=include_suites))

+    def has_tests(self):
+        return any(ch.has_tests() for ch in self.children)
+
     def __iter__(self):
         for table in [self.setting_table, self.variable_table,
                       self.keyword_table]:

Reply via email to