Merge lp:~eeejay/mago/tweaks into lp:~mago-contributors/mago/mago-1.0

Proposed by Eitan Isaacson
Status: Merged
Merged at revision: not available
Proposed branch: lp:~eeejay/mago/tweaks
Merge into: lp:~mago-contributors/mago/mago-1.0
Diff against target: None lines
To merge this branch: bzr merge lp:~eeejay/mago/tweaks
Reviewer Review Type Date Requested Status
Ubuntu Desktop Testing Contributors Pending
Review via email: mp+4339@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Eitan Isaacson (eeejay) wrote :

Hey!
This adds a screenshot comparer to checks.py, and other minor changes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/ubuntu-desktop-test'
--- bin/ubuntu-desktop-test 2009-03-04 12:27:22 +0000
+++ bin/ubuntu-desktop-test 2009-03-04 14:30:30 +0000
@@ -109,7 +109,7 @@
109109
110 suite = os.path.basename(file)110 suite = os.path.basename(file)
111111
112 pattern = r"[a-z0-9][-_a-z0-9+.]*.xml"112 pattern = r"[a-z0-9][-_a-z0-9+.]*.xml$"
113 if not re.match(pattern, suite, re.I):113 if not re.match(pattern, suite, re.I):
114 logging.debug("Suite name `%s' does not match pattern: %s",114 logging.debug("Suite name `%s' does not match pattern: %s",
115 file, pattern)115 file, pattern)
116116
=== modified file 'desktoptesting/check.py'
--- desktoptesting/check.py 2008-08-21 11:18:49 +0000
+++ desktoptesting/check.py 2009-03-04 10:34:51 +0000
@@ -6,6 +6,8 @@
6import filecmp6import filecmp
7import os7import os
8import sys8import sys
9import shutil
10from ldtputils import imagecompare
911
10FAIL = "fail"12FAIL = "fail"
11PASS = "pass"13PASS = "pass"
@@ -36,7 +38,7 @@
3638
37 if not (os.path.exists(oracle) and os.path.exists(test)):39 if not (os.path.exists(oracle) and os.path.exists(test)):
38 print "Both oracle and test file must exist"40 print "Both oracle and test file must exist"
39 sys.exit(0)41 raise Exception
4042
41 self.oracle = oracle43 self.oracle = oracle
42 self.test = test44 self.test = test
@@ -52,5 +54,13 @@
52 else:54 else:
53 return FAIL55 return FAIL
5456
5557class ScreenshotCompare(FileComparison):
5658 def perform_test(self, max_diff=0.0):
59 res = imagecompare(self.oracle, self.test)
60 if res > max_diff:
61 return FAIL
62 else:
63 return PASS
64
65 def calibrate(self):
66 shutil.copy(self.test, self.oracle)

Subscribers

People subscribed via source and target branches

to status/vote changes: