Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: media/tools/layout_tests/layouttest_analyzer_helpers.py

Issue 10986008: Switch to using WebKit's test expecation parser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/tools/layout_tests/test_expectations.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Helper functions for the layout test analyzer.""" 5 """Helper functions for the layout test analyzer."""
6 6
7 from datetime import datetime 7 from datetime import datetime
8 from email.mime.multipart import MIMEMultipart 8 from email.mime.multipart import MIMEMultipart
9 from email.mime.text import MIMEText 9 from email.mime.text import MIMEText
10 import fileinput 10 import fileinput
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 classify them as 'whole', 'skip' or 'nonskip' based on that information. 46 classify them as 'whole', 'skip' or 'nonskip' based on that information.
47 47
48 Args: 48 Args:
49 test_info_map: the result map of |layouttests.JoinWithTestExpectation|. 49 test_info_map: the result map of |layouttests.JoinWithTestExpectation|.
50 The key of the map is test name such as 'media/media-foo.html'. 50 The key of the map is test name such as 'media/media-foo.html'.
51 The value of the map is a map that contains the following keys: 51 The value of the map is a map that contains the following keys:
52 'desc'(description), 'te_info' (test expectation information), 52 'desc'(description), 'te_info' (test expectation information),
53 which is a list of test expectation information map. The key of the 53 which is a list of test expectation information map. The key of the
54 test expectation information map is test expectation keywords such 54 test expectation information map is test expectation keywords such
55 as "SKIP" and other keywords (for full list of keywords, please 55 as "SKIP" and other keywords (for full list of keywords, please
56 refer to |test_expectaions.ALL_TE_KEYWORDS|). 56 refer to |test_expectaions.ALL_TE_KEYWORDS|).
Ami GONE FROM CHROMIUM 2012/09/25 00:40:30 test_expectaions typo
DaleCurtis 2012/09/25 01:14:50 Done.
57 """ 57 """
58 self.result_map = {} 58 self.result_map = {}
59 self.result_map['whole'] = {} 59 self.result_map['whole'] = {}
60 self.result_map['skip'] = {} 60 self.result_map['skip'] = {}
61 self.result_map['nonskip'] = {} 61 self.result_map['nonskip'] = {}
62 if test_info_map: 62 if test_info_map:
63 for (k, value) in test_info_map.iteritems(): 63 for (k, value) in test_info_map.iteritems():
64 self.result_map['whole'][k] = value 64 self.result_map['whole'][k] = value
65 if 'te_info' in value: 65 if 'te_info' in value:
66 # Don't count SLOW PASS or WONTFIX tests as failures. 66 # Don't count SLOW PASS, WONTFIX, or ANDROID tests as failures.
67 if any([True for x in value['te_info'] if set(x.keys()) == 67 if any([True for x in value['te_info'] if set(x.keys()) ==
Ami GONE FROM CHROMIUM 2012/09/25 00:40:30 I'm confused by the == (I'd expect a "containedIn"
DaleCurtis 2012/09/25 01:14:50 Doing a subset would match SLOW PASS IMAGE.
68 set(['SLOW', 'PASS', 'Bugs', 'Comments']) or 'WONTFIX' in x]): 68 set(['SLOW', 'PASS', 'Bugs', 'Comments', 'Platforms']) or
Ami GONE FROM CHROMIUM 2012/09/25 00:40:30 indent is off?
DaleCurtis 2012/09/25 01:14:50 Done.
69 continue 69 'WONTFIX' in x or x['Platforms'] == ['ANDROID']]):
70 # Ignore failures on the ANDROID platform.
71 if value['te_info']['Platforms'] == ['ANDROID']:
72 continue 70 continue
73 if any([True for x in value['te_info'] if 'SKIP' in x]): 71 if any([True for x in value['te_info'] if 'SKIP' in x]):
74 self.result_map['skip'][k] = value 72 self.result_map['skip'][k] = value
75 else: 73 else:
76 self.result_map['nonskip'][k] = value 74 self.result_map['nonskip'][k] = value
77 75
78 @staticmethod 76 @staticmethod
79 def GetDiffString(diff_map_element, type_str): 77 def GetDiffString(diff_map_element, type_str):
80 """Get difference string out of diff map element. 78 """Get difference string out of diff map element.
81 79
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 list2 = map2[name]['te_info'] 595 list2 = map2[name]['te_info']
598 te_diff = [item for item in list1 if not item in list2] 596 te_diff = [item for item in list1 if not item in list2]
599 if te_diff: 597 if te_diff:
600 name_list.append((name, te_diff)) 598 name_list.append((name, te_diff))
601 else: 599 else:
602 name_list.append((name, value1)) 600 name_list.append((name, value1))
603 return name_list 601 return name_list
604 602
605 return (GetDiffBetweenMapsHelper(map1, map2, lookIntoTestExpectationInfo), 603 return (GetDiffBetweenMapsHelper(map1, map2, lookIntoTestExpectationInfo),
606 GetDiffBetweenMapsHelper(map2, map1, lookIntoTestExpectationInfo)) 604 GetDiffBetweenMapsHelper(map2, map1, lookIntoTestExpectationInfo))
OLDNEW
« no previous file with comments | « no previous file | media/tools/layout_tests/test_expectations.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698