[CalendarServer-changes] [14916] CalDAVTester/trunk/src

source_changes at macosforge.org source_changes at macosforge.org
Thu Jun 25 14:55:01 PDT 2015


Revision: 14916
          http://trac.calendarserver.org//changeset/14916
Author:   cdaboo at apple.com
Date:     2015-06-25 14:55:01 -0700 (Thu, 25 Jun 2015)
Log Message:
-----------
Include overall test suite progress in the normal output.

Modified Paths:
--------------
    CalDAVTester/trunk/src/manager.py
    CalDAVTester/trunk/src/observers/log.py

Modified: CalDAVTester/trunk/src/manager.py
===================================================================
--- CalDAVTester/trunk/src/manager.py	2015-06-25 21:49:45 UTC (rev 14915)
+++ CalDAVTester/trunk/src/manager.py	2015-06-25 21:55:01 UTC (rev 14916)
@@ -90,6 +90,14 @@
         map(lambda x: x.message(message, *args, **kwargs), self.observers)
 
 
+    def testProgress(self, count, total):
+        results = {
+            "count": count,
+            "total": total,
+        }
+        self.message("testProgress", results)
+
+
     def testFile(self, name, details, result=None):
         self.results.append({
             "name": name,
@@ -367,7 +375,9 @@
         failed = 0
         ignored = 0
         try:
-            for test in self.tests:
+            for ctr, test in enumerate(self.tests):
+                if len(self.tests) > 1:
+                    self.testProgress(ctr + 1, len(self.tests))
                 if self.pretest is not None:
                     o, f, i = self.pretest.run()
 

Modified: CalDAVTester/trunk/src/observers/log.py
===================================================================
--- CalDAVTester/trunk/src/observers/log.py	2015-06-25 21:49:45 UTC (rev 14915)
+++ CalDAVTester/trunk/src/observers/log.py	2015-06-25 21:55:01 UTC (rev 14916)
@@ -42,6 +42,7 @@
         super(Observer, self).updateCalls()
         self._calls.update({
             "start": self.start,
+            "testProgress": self.testProgress,
             "testFile": self.testFile,
             "testSuite": self.testSuite,
             "testResult": self.testResult,
@@ -55,6 +56,11 @@
             self.manager.logit("Randomizing order using seed '{rs}'".format(rs=self.manager.randomSeed))
 
 
+    def testProgress(self, result):
+        self.manager.logit("")
+        self.manager.logit("File {count} of {total}".format(**result))
+
+
     def testFile(self, result):
         self.currentFile = result["name"].replace("/", ".")[:-4]
         self.manager.logit("")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150625/9b9b9921/attachment.html>


More information about the calendarserver-changes mailing list