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
1=== modified file 'bin/ubuntu-desktop-test'
2--- bin/ubuntu-desktop-test 2009-03-04 12:27:22 +0000
3+++ bin/ubuntu-desktop-test 2009-03-04 14:30:30 +0000
4@@ -109,7 +109,7 @@
5
6 suite = os.path.basename(file)
7
8- pattern = r"[a-z0-9][-_a-z0-9+.]*.xml"
9+ pattern = r"[a-z0-9][-_a-z0-9+.]*.xml$"
10 if not re.match(pattern, suite, re.I):
11 logging.debug("Suite name `%s' does not match pattern: %s",
12 file, pattern)
13
14=== modified file 'desktoptesting/check.py'
15--- desktoptesting/check.py 2008-08-21 11:18:49 +0000
16+++ desktoptesting/check.py 2009-03-04 10:34:51 +0000
17@@ -6,6 +6,8 @@
18 import filecmp
19 import os
20 import sys
21+import shutil
22+from ldtputils import imagecompare
23
24 FAIL = "fail"
25 PASS = "pass"
26@@ -36,7 +38,7 @@
27
28 if not (os.path.exists(oracle) and os.path.exists(test)):
29 print "Both oracle and test file must exist"
30- sys.exit(0)
31+ raise Exception
32
33 self.oracle = oracle
34 self.test = test
35@@ -52,5 +54,13 @@
36 else:
37 return FAIL
38
39-
40-
41+class ScreenshotCompare(FileComparison):
42+ def perform_test(self, max_diff=0.0):
43+ res = imagecompare(self.oracle, self.test)
44+ if res > max_diff:
45+ return FAIL
46+ else:
47+ return PASS
48+
49+ def calibrate(self):
50+ shutil.copy(self.test, self.oracle)

Subscribers

People subscribed via source and target branches

to status/vote changes: