summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2012-06-14 18:06:36 -0300
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-06-18 09:29:52 +0100
commit7457d361a6fba637c540a5df39d2c93c691ab12c (patch)
tree4318cef99dadb27889dea9f73027f93cfb7048b1
parent041bf1e4503ff3458334096d0febd8fec11f8faf (diff)
Handle global checklist items.
-rw-r--r--insanity/dbustest.py3
-rw-r--r--insanity/test.py33
-rw-r--r--insanity/testmetadata.py14
3 files changed, 12 insertions, 38 deletions
diff --git a/insanity/dbustest.py b/insanity/dbustest.py
index 3b90532..9b81dd1 100644
--- a/insanity/dbustest.py
+++ b/insanity/dbustest.py
@@ -453,9 +453,6 @@ class DBusTest(Test, dbus.service.Object):
def getFullCheckList(self):
return self._metadata.getFullCheckList()
- def getSharedCheckList(self):
- return self._metadata.getSharedCheckList()
-
def getFullArgumentList(self):
return self._metadata.getFullArgumentList()
diff --git a/insanity/test.py b/insanity/test.py
index 6db6966..148c0cf 100644
--- a/insanity/test.py
+++ b/insanity/test.py
@@ -112,10 +112,13 @@ class Test(gobject.GObject):
__test_checklist__ = {
"test-started": {
+ "global": False,
"description": "The test started"},
"no-timeout": {
+ "global": False,
"description": "The test didn't timeout"},
"no-unexpected-failures": {
+ "global": False,
"description": "All failed checks were expected."},
}
"""
@@ -463,12 +466,15 @@ class Test(gobject.GObject):
self._running = True
self.emit("start", self._iteration)
self.validateChecklistItem("test-started")
+
if self._iteration > 1:
- for shareditems in self.getSharedCheckList():
- for name, res in self.getIterationCheckList(self._iteration -1):
- if name == shareditems:
- self.validateChecklistItem(name, res)
- break
+ iteraction_checklist = self.getIterationCheckList(self._iteration - 1)
+ for item, value in self.getFullCheckList().iteritems():
+ if value.get("global", False):
+ for name, res in iteraction_checklist:
+ if item == name:
+ self.validateChecklistItem(name, res)
+ break
# start timeout for test !
self._testtimeouttime = time.time() + self._timeout
@@ -577,20 +583,6 @@ class Test(gobject.GObject):
return dc
@classmethod
- def getClassSharedCheckList(cls):
- """
- Returns the shared test checklist. This is used to know the checklist
- item result that are shared between iterations of start/stop
- """
- dc = {}
- for cl in cls.mro():
- if "__test_shared_checklist_items__" in cl.__dict__:
- dc.update(cl.__test_shared_checklist_items__)
- if cl == Test:
- break
- return dc
-
- @classmethod
def getClassFullArgumentList(cls):
"""
Returns the full list of arguments with descriptions.
@@ -819,9 +811,6 @@ class Test(gobject.GObject):
def getFullCheckList(self):
raise NotImplementedError
- def getSharedCheckList(self):
- raise NotImplementedError
-
def getTestName(self):
return self.__test_name__
diff --git a/insanity/testmetadata.py b/insanity/testmetadata.py
index e07e45d..159e345 100644
--- a/insanity/testmetadata.py
+++ b/insanity/testmetadata.py
@@ -108,8 +108,6 @@ class TestMetadata():
self.__test_arguments__ = self.get_metadata (metadata, "__arguments__")
self.__test_output_files__ = self.get_metadata (metadata, "__output_files__")
self.__test_checklist__ = self.get_metadata (metadata, "__checklist__")
- self.__test_shared_checklist_items__ = self.get_metadata (metadata,
- "__shared_checklist_items__")
self.__test_extra_infos__ = self.get_metadata (metadata, "__extra_infos__")
info('It is a valid test')
@@ -133,6 +131,7 @@ class TestMetadata():
The format of the returned argument dictionary is:
key : checklist name
value : dictionary with :
+ global: if this is a global checklist item
description: short description
likely_error: The likely error
"""
@@ -141,17 +140,6 @@ class TestMetadata():
dc.update(self.__test_checklist__)
return dc
- def getSharedCheckList(self):
- """
- Return the list of checklist items that are shared between iterations
- of start/stop
- """
- dc = self.__test_class__.getClassSharedCheckList()
- if self.__test_shared_checklist_items__ != None:
- dc.update(self.__test_shared_checklist_items__)
- return dc
-
-
def getFullArgumentList(self):
"""
Returns the full list of arguments with descriptions.