[llvm-commits] [zorg] r101578 - in /zorg/trunk/zorg/buildbot/commands: DejaGNUCommand.py __init__.py

Daniel Dunbar daniel at zuster.org
Fri Apr 16 16:36:12 PDT 2010


Author: ddunbar
Date: Fri Apr 16 18:36:12 2010
New Revision: 101578

URL: http://llvm.org/viewvc/llvm-project?rev=101578&view=rev
Log:
Switch DejaGNUCommand to use new StandardizedTest.

Modified:
    zorg/trunk/zorg/buildbot/commands/DejaGNUCommand.py
    zorg/trunk/zorg/buildbot/commands/__init__.py

Modified: zorg/trunk/zorg/buildbot/commands/DejaGNUCommand.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/commands/DejaGNUCommand.py?rev=101578&r1=101577&r2=101578&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/commands/DejaGNUCommand.py (original)
+++ zorg/trunk/zorg/buildbot/commands/DejaGNUCommand.py Fri Apr 16 18:36:12 2010
@@ -1,56 +1,33 @@
 import re
-import buildbot
-import buildbot.status.builder
-from buildbot.steps.shell import Test
-
-class DejaGNUCommand(Test):
-    command=["make", "check"]
-    total = 0
-    description = "testing llvm"
-    descriptionDone = "test llvm"
-    def describe(self, done=False):
-        result = Test.describe(self, done)
-        return result
-    def evaluateCommand(self, cmd):
-        # FIXME: This doesn't detect failures if dejagnu doesn't run.
-        rc = 0
-        lines = self.getLog('stdio').readlines()
-        failre = re.compile("^FAIL:.*")
-        faillines = []
-        xpass_result = re.compile("^# of unexpected passes\s*(\d+)")
-        xpasses = 0
-        xfail_result = re.compile("^# of expected failures\s*(\d+)")
-        xfails = 0
-        fail_result = re.compile("^# of unexpected failures\s*(\d+)")
-        fails = 0
-        pass_result = re.compile("^# of expected passes\s*(\d+)")
-        passes = 0
-        fails_list = []
-        for line in lines:
-            result = failre.search(line)
-            if result:
-                faillines.append(line)
-            result =  xpass_result.search(line)
-            if result:
-                xpasses += int(result.group(1))
-            result =  xfail_result.search(line)
-            if result:
-                xfails += int(result.group(1))
-            result =  pass_result.search(line)
-            if result:
-                passes += int(result.group(1))
-            result =  fail_result.search(line)
-            if result:
-                fails += int(result.group(1))
-                fails_list.append(line)
-        if faillines:
-            self.addCompleteLog("fails", "\n".join(faillines) + "\n")
-        if fails == 0:
-            rc = buildbot.status.builder.SUCCESS
-        else:
-            rc = buildbot.status.builder.FAILURE
-        self.setTestResults(total = fails+xpasses+xfails+passes, 
-                            failed = fails, 
-                            passed = passes, 
-                            warnings = xpasses + xfails)
-        return rc
+import StandardizedTest
+
+class DejaGNUCommand(StandardizedTest.StandardizedTest):
+    kRunningRE = re.compile(r'Running (.*) ...')
+    kRunningRE = re.compile(r'Running (.*) ...')
+    kTestStateLineRE = re.compile(r'(FAIL|PASS|XFAIL|XPASS|UNRESOLVED): (.*)')
+
+    testLogName = 'dg.sum'
+
+    def parseLog(self, lines):
+        results = []
+
+        test_suite = None
+        for ln in lines:
+            m = self.kRunningRE.match(ln)
+            if m is not None:
+                test_suite, = m.groups()
+                continue
+
+            m = self.kTestStateLineRE.match(ln)
+            if m is not None:
+                code,name = m.groups()
+                results.append((code, name, None))
+                continue
+
+        return results
+
+if __name__ == '__main__':
+    import sys
+    t = DejaGNUCommand()
+    for res in t.parseLog(open(sys.argv[1]).readlines()):
+        print res

Modified: zorg/trunk/zorg/buildbot/commands/__init__.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/buildbot/commands/__init__.py?rev=101578&r1=101577&r2=101578&view=diff
==============================================================================
--- zorg/trunk/zorg/buildbot/commands/__init__.py (original)
+++ zorg/trunk/zorg/buildbot/commands/__init__.py Fri Apr 16 18:36:12 2010
@@ -1,6 +1,7 @@
 import AnalyzerCompareCommand
 import BatchFileDownload
 import ClangTestCommand
+import LitTestCommand
 import DejaGNUCommand
 import GTestCommand
 





More information about the llvm-commits mailing list