summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2012-04-03 15:48:27 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-04-03 15:48:27 +0200
commit36f7f4cf001736130492de2ed49de054e74862ff (patch)
tree74ead73d1b1632cdf02dee4b79985ff93af94f8d
parent92501de4a32b3d2deb1558fe1e998f66bc454f19 (diff)
Rename step to checklist item in the DBus/Python parts too
-rw-r--r--insanity/dbustest.py18
-rw-r--r--insanity/monitor.py12
-rw-r--r--insanity/scenario.py2
-rw-r--r--insanity/test.py26
-rw-r--r--lib/insanity/insanitytest.c8
5 files changed, 33 insertions, 33 deletions
diff --git a/insanity/dbustest.py b/insanity/dbustest.py
index 2e8b57b..edeab48 100644
--- a/insanity/dbustest.py
+++ b/insanity/dbustest.py
@@ -193,11 +193,11 @@ class DBusTest(Test, dbus.service.Object):
self._pid = self._process.pid
except:
exception("Error starting the subprocess command ! %r", pargs)
- self.validateStep("dbus-process-spawned", False)
+ self.validateChecklistItem("dbus-process-spawned", False)
return False
debug("Subprocess created successfully [pid:%d]", self._pid)
- self.validateStep("dbus-process-spawned")
+ self.validateChecklistItem("dbus-process-spawned")
# add a poller for the proces
self._processpollid = gobject.timeout_add(500, self._pollSubProcess)
# Don't forget to set a timeout for waiting for the connection
@@ -235,7 +235,7 @@ class DBusTest(Test, dbus.service.Object):
self._process = None
if not self._returncode is None:
info("Process returned %d", self._returncode)
- self.validateStep("subprocess-exited-normally", self._returncode == 0)
+ self.validateChecklistItem("subprocess-exited-normally", self._returncode == 0)
self.extraInfo("subprocess-return-code", self._returncode)
Test.tearDown(self)
@@ -372,10 +372,10 @@ class DBusTest(Test, dbus.service.Object):
self.ping()
self.stop()
- def _remoteValidateStepCb(self, step, validate, desc):
- info("%s step:%s : %r", self.uuid, step, validate)
+ def _remoteValidateChecklistItemCb(self, item, validate, desc):
+ info("%s checklist item:%s : %r", self.uuid, item, validate)
self.ping()
- self.validateStep(unwrap(step), validate, desc)
+ self.validateChecklistItem(unwrap(item), validate, desc)
def _remoteExtraInfoCb(self, key, value):
info("%s key:%s value:%r", self.uuid, key, value)
@@ -393,7 +393,7 @@ class DBusTest(Test, dbus.service.Object):
return
info("%s our remote counterpart has started", self.uuid)
- self.validateStep("dbus-process-connected")
+ self.validateChecklistItem("dbus-process-connected")
self._subprocessconnecttime = time.time()
delay = self._subprocessconnecttime - self._subprocessspawntime
self.extraInfo("subprocess-spawn-time", int(delay * 1000))
@@ -419,8 +419,8 @@ class DBusTest(Test, dbus.service.Object):
self._remoteReadyCb)
self._remoteinstance.connect_to_signal("remoteStopSignal",
self._remoteStopCb)
- self._remoteinstance.connect_to_signal("remoteValidateStepSignal",
- self._remoteValidateStepCb)
+ self._remoteinstance.connect_to_signal("remoteValidateChecklistItemSignal",
+ self._remoteValidateChecklistItemCb)
self._remoteinstance.connect_to_signal("remoteExtraInfoSignal",
self._remoteExtraInfoCb)
self._remoteinstance.connect_to_signal("remotePingSignal",
diff --git a/insanity/monitor.py b/insanity/monitor.py
index 631bccc..c138644 100644
--- a/insanity/monitor.py
+++ b/insanity/monitor.py
@@ -138,14 +138,14 @@ class Monitor(object):
## Methods for tests to return information
- def validateStep(self, checkitem):
+ def validateChecklistItem(self, checkitem):
"""
- Validate a step in the checklist.
+ Validate a checklist item in the checklist.
checkitem is one of the keys of __test_checklist__
Called by the test itself
"""
- info("step %s for item %r" % (checkitem, self))
+ info("checklist item %s for item %r" % (checkitem, self))
if not checkitem in self._checklist:
return
self._checklist[checkitem] = True
@@ -207,10 +207,10 @@ class Monitor(object):
Returns the success rate of this instance as a float
"""
ckl = self.getCheckList()
- nbsteps = len(ckl)
- if nbsteps:
+ nbitems = len(ckl)
+ if nbitems:
nbsucc = len([x for x in ckl if ckl[x] == True])
- return (100.0 * nbsucc) / nbsteps
+ return (100.0 * nbsucc) / nbitems
# yes, no check items means 100% success for monitors
return 100.0
diff --git a/insanity/scenario.py b/insanity/scenario.py
index 2a0ca4e..00f601e 100644
--- a/insanity/scenario.py
+++ b/insanity/scenario.py
@@ -227,7 +227,7 @@ class ListScenario(Scenario):
__test_full_description__ = """
This scenario will execute the given tests one after the other.
If fata-subtest-failure is set to True, then it will stop whenever
- one test hasn't succeeded fully (all steps validated).
+ one test hasn't succeeded fully (all checklist items validated).
"""
def setUp(self):
diff --git a/insanity/test.py b/insanity/test.py
index 93c1aa7..f146b2c 100644
--- a/insanity/test.py
+++ b/insanity/test.py
@@ -414,7 +414,7 @@ class Test(gobject.GObject):
gobject.source_remove(self._testtimeoutid)
self._testtimeoutid = 0
notimeout = True
- self.validateStep("no-timeout", notimeout)
+ self.validateChecklistItem("no-timeout", notimeout)
self.iteration_checklist[self._iteration] = self._checklist
self.iteration_extrainfo[self._iteration] = self._extrainfo
self.iteration_outputfiles[self._iteration] = self._outputfiles
@@ -452,7 +452,7 @@ class Test(gobject.GObject):
int((curtime - self._teststarttime) * 1000))
self._running = True
self.emit("start", self._iteration)
- self.validateStep("test-started")
+ self.validateChecklistItem("test-started")
# start timeout for test !
self._testtimeouttime = time.time() + self._timeout
self._testtimeoutid = gobject.timeout_add(self._timeout * 1000,
@@ -468,16 +468,16 @@ class Test(gobject.GObject):
## Methods for tests to return information
- def validateStep(self, checkitem, validated=True, description = None):
+ def validateChecklistItem(self, checkitem, validated=True, description = None):
"""
- Validate a step in the checklist.
+ Validate a checklist item in the checklist.
checkitem is one of the keys of __test_checklist__
- validated is a boolean indicating whether that step should be
+ validated is a boolean indicating whether that item should be
validated or not.
Called by the test itself
"""
- info("step %s for item %r : %r" % (checkitem, self, validated))
+ info("checklist item %s for item %r : %r" % (checkitem, self, validated))
# check for valid checkitem
if not checkitem in self._possiblechecklist:
return
@@ -607,7 +607,7 @@ class Test(gobject.GObject):
"""
Returns the instance checklist as a list of tuples of:
* checkitem name
- * value indicating whether the success of that step
+ * value indicating whether the success of that checklist item
That value can be one of: SKIPPED, SUCCESS, FAILURE, EXPECTED_FAILURE
"""
allk = self.getFullCheckList().keys()
@@ -664,17 +664,17 @@ class Test(gobject.GObject):
"""
Returns the success rate of this instance as a float
"""
- total_nbsteps = 0
+ total_nbitems = 0
total_nbsucc = 0
for iteration in self.iteration_checklist:
ckl = self.getIterationCheckList(iteration)
- nbsteps = len(self._possiblechecklist)
- nbsucc = len([step for step, val in ckl if val == True])
- total_nbsteps = total_nbsteps + nbsteps
+ nbitems = len(self._possiblechecklist)
+ nbsucc = len([item for item, val in ckl if val == True])
+ total_nbitems = total_nbitems + nbitems
total_nbsucc = total_nbsucc + nbsucc
- if total_nbsteps == 0:
+ if total_nbitems == 0:
return 0.0
- return (100.0 * total_nbsucc) / total_nbsteps
+ return (100.0 * total_nbsucc) / total_nbitems
def getIterationExtraInfo(self,iteration):
"""
diff --git a/lib/insanity/insanitytest.c b/lib/insanity/insanitytest.c
index 4781e5a..f485735 100644
--- a/lib/insanity/insanitytest.c
+++ b/lib/insanity/insanitytest.c
@@ -394,7 +394,7 @@ insanity_test_record_stop_time (InsanityTest * test)
" </signal>\n" \
" <signal name=\"remoteStopSignal\">\n" \
" </signal>\n" \
- " <signal name=\"remoteValidateStepSignal\">\n" \
+ " <signal name=\"remoteValidateChecklistItemSignal\">\n" \
" <arg name=\"name\" type=\"s\" />\n" \
" <arg name=\"success\" type=\"b\" />\n" \
" <arg name=\"description\" type=\"s\" />\n" \
@@ -587,8 +587,8 @@ insanity_test_validate_checklist_item (InsanityTest * test, const char *label,
/* if the item has already been (in)validated, then we invalidate if success is FALSE,
and do nothing if success is TRUE. This ends up doing a AND operation on all booleans
- passed for that step (ie, a step succeeds only if all calls to validate for that
- step succeed, and fails if any call to validate for that step fails). */
+ passed for that checklist item (ie, a checklist item succeeds only if all calls to
+ validate for that item succeed, and fails if any call to validate for that item fails). */
if (g_hash_table_lookup (test->priv->checklist_results, label) != NULL) {
if (success) {
UNLOCK (test);
@@ -605,7 +605,7 @@ insanity_test_validate_checklist_item (InsanityTest * test, const char *label,
}
} else {
const char *desc = description ? description : "";
- send_signal (test->priv->conn, "remoteValidateStepSignal", test->priv->name,
+ send_signal (test->priv->conn, "remoteValidateChecklistItemSignal", test->priv->name,
DBUS_TYPE_STRING, &label, DBUS_TYPE_BOOLEAN, &success,
DBUS_TYPE_STRING, &desc, DBUS_TYPE_INVALID);
}