OLD | NEW |
1 # Copyright (C) 2012 Google Inc. All rights reserved. | 1 # Copyright (C) 2012 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 if total > 0: | 61 if total > 0: |
62 percent_passed = float(passed) * 100 / total | 62 percent_passed = float(passed) * 100 / total |
63 | 63 |
64 self._print("=> Results: %d/%d tests passed (%.1f%%)" % (passed, total,
percent_passed)) | 64 self._print("=> Results: %d/%d tests passed (%.1f%%)" % (passed, total,
percent_passed)) |
65 self._print("") | 65 self._print("") |
66 self._print_run_results_entry(run_results, test_expectations.NOW, "Tests
to be fixed") | 66 self._print_run_results_entry(run_results, test_expectations.NOW, "Tests
to be fixed") |
67 | 67 |
68 self._print("") | 68 self._print("") |
69 # FIXME: We should be skipping anything marked WONTFIX, so we shouldn't
bother logging these stats. | 69 # FIXME: We should be skipping anything marked WONTFIX, so we shouldn't
bother logging these stats. |
70 self._print_run_results_entry(run_results, test_expectations.WONTFIX, | 70 self._print_run_results_entry(run_results, test_expectations.WONTFIX, |
71 "Tests that will only be fixed if they crash (WONTFIX)") | 71 "Tests that will only be fixed if they cra
sh (WONTFIX)") |
72 self._print("") | 72 self._print("") |
73 | 73 |
74 def _print_run_results_entry(self, run_results, timeline, heading): | 74 def _print_run_results_entry(self, run_results, timeline, heading): |
75 total = len(run_results.tests_by_timeline[timeline]) | 75 total = len(run_results.tests_by_timeline[timeline]) |
76 not_passing = (total - | 76 not_passing = (total - |
77 len(run_results.tests_by_expectation[test_expectations.PASS] & | 77 len(run_results.tests_by_expectation[test_expectations.PA
SS] & |
78 run_results.tests_by_timeline[timeline])) | 78 run_results.tests_by_timeline[timeline])) |
79 self._print("=> %s (%d):" % (heading, not_passing)) | 79 self._print("=> %s (%d):" % (heading, not_passing)) |
80 | 80 |
81 for result in TestExpectations.EXPECTATION_DESCRIPTIONS.keys(): | 81 for result in TestExpectations.EXPECTATION_DESCRIPTIONS.keys(): |
82 if result in (test_expectations.PASS, test_expectations.SKIP): | 82 if result in (test_expectations.PASS, test_expectations.SKIP): |
83 continue | 83 continue |
84 results = (run_results.tests_by_expectation[result] & run_results.te
sts_by_timeline[timeline]) | 84 results = (run_results.tests_by_expectation[result] & run_results.te
sts_by_timeline[timeline]) |
85 desc = TestExpectations.EXPECTATION_DESCRIPTIONS[result] | 85 desc = TestExpectations.EXPECTATION_DESCRIPTIONS[result] |
86 if not_passing and len(results): | 86 if not_passing and len(results): |
87 pct = len(results) * 100.0 / not_passing | 87 pct = len(results) * 100.0 / not_passing |
88 self._print(" %5d %-24s (%4.1f%%)" % (len(results), desc, pct)) | 88 self._print(" %5d %-24s (%4.1f%%)" % (len(results), desc, pct)) |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 for key, tests in flaky.iteritems(): | 136 for key, tests in flaky.iteritems(): |
137 result_type = TestExpectations.EXPECTATIONS[key.lower()] | 137 result_type = TestExpectations.EXPECTATIONS[key.lower()] |
138 self._print("Unexpected flakiness: %s (%d)" % (descriptions[resu
lt_type], len(tests))) | 138 self._print("Unexpected flakiness: %s (%d)" % (descriptions[resu
lt_type], len(tests))) |
139 tests.sort() | 139 tests.sort() |
140 | 140 |
141 for test in tests: | 141 for test in tests: |
142 result = layouttestresults.result_for_test(summarized_result
s['tests'], test) | 142 result = layouttestresults.result_for_test(summarized_result
s['tests'], test) |
143 actual = result['actual'].split(" ") | 143 actual = result['actual'].split(" ") |
144 expected = result['expected'].split(" ") | 144 expected = result['expected'].split(" ") |
145 # FIXME: clean this up once the old syntax is gone | 145 # FIXME: clean this up once the old syntax is gone |
146 new_expectations_list = [TestExpectationParser._inverted_exp
ectation_tokens[exp] for exp in list(set(actual) | set(expected))] | 146 new_expectations_list = [TestExpectationParser._inverted_exp
ectation_tokens[exp] |
| 147 for exp in list(set(actual) | set(e
xpected))] |
147 self._print(" %s [ %s ]" % (test, " ".join(new_expectations
_list))) | 148 self._print(" %s [ %s ]" % (test, " ".join(new_expectations
_list))) |
148 self._print("") | 149 self._print("") |
149 self._print("") | 150 self._print("") |
150 | 151 |
151 if len(regressions): | 152 if len(regressions): |
152 descriptions = TestExpectations.EXPECTATION_DESCRIPTIONS | 153 descriptions = TestExpectations.EXPECTATION_DESCRIPTIONS |
153 for key, tests in regressions.iteritems(): | 154 for key, tests in regressions.iteritems(): |
154 result_type = TestExpectations.EXPECTATIONS[key.lower()] | 155 result_type = TestExpectations.EXPECTATIONS[key.lower()] |
155 self._print("Regressions: Unexpected %s (%d)" % (descriptions[re
sult_type], len(tests))) | 156 self._print("Regressions: Unexpected %s (%d)" % (descriptions[re
sult_type], len(tests))) |
156 tests.sort() | 157 tests.sort() |
157 for test in tests: | 158 for test in tests: |
158 result = layouttestresults.result_for_test(summarized_result
s['tests'], test) | 159 result = layouttestresults.result_for_test(summarized_result
s['tests'], test) |
159 actual = result['actual'].split(" ") | 160 actual = result['actual'].split(" ") |
160 expected = result['expected'].split(" ") | 161 expected = result['expected'].split(" ") |
161 new_expectations_list = [TestExpectationParser._inverted_exp
ectation_tokens[exp] for exp in actual] | 162 new_expectations_list = [TestExpectationParser._inverted_exp
ectation_tokens[exp] for exp in actual] |
162 self._print(" %s [ %s ]" % (test, " ".join(new_expectations
_list))) | 163 self._print(" %s [ %s ]" % (test, " ".join(new_expectations
_list))) |
163 self._print("") | 164 self._print("") |
164 | 165 |
165 if len(summarized_results['tests']) and self.debug_logging: | 166 if len(summarized_results['tests']) and self.debug_logging: |
166 self._print("%s" % ("-" * 78)) | 167 self._print("%s" % ("-" * 78)) |
OLD | NEW |