OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import collections | 5 import collections |
6 import copy | 6 import copy |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import pickle | 9 import pickle |
10 import re | 10 import re |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 'VERSION': _PICKLE_FORMAT_VERSION, | 539 'VERSION': _PICKLE_FORMAT_VERSION, |
540 'JAR_MD5SUM': jar_md5, | 540 'JAR_MD5SUM': jar_md5, |
541 'TEST_METHODS': tests, | 541 'TEST_METHODS': tests, |
542 } | 542 } |
543 with open(pickle_path, 'w') as pickle_file: | 543 with open(pickle_path, 'w') as pickle_file: |
544 pickle.dump(pickle_data, pickle_file) | 544 pickle.dump(pickle_data, pickle_file) |
545 | 545 |
546 def _FilterTests(self, tests): | 546 def _FilterTests(self, tests): |
547 | 547 |
548 def gtest_filter(c, m): | 548 def gtest_filter(c, m): |
549 t = ['%s.%s' % (c['class'].split('.')[-1], m['method'])] | 549 if not self._test_filter: |
550 return (not self._test_filter | 550 return True |
551 or unittest_util.FilterTestNames(t, self._test_filter)) | 551 # Allow fully-qualified name as well as an omitted package. |
| 552 names = ['%s.%s' % (c['class'], m['method']), |
| 553 '%s.%s' % (c['class'].split('.')[-1], m['method'])] |
| 554 return unittest_util.FilterTestNames(names, self._test_filter) |
552 | 555 |
553 def annotation_filter(all_annotations): | 556 def annotation_filter(all_annotations): |
554 if not self._annotations: | 557 if not self._annotations: |
555 return True | 558 return True |
556 return any_annotation_matches(self._annotations, all_annotations) | 559 return any_annotation_matches(self._annotations, all_annotations) |
557 | 560 |
558 def excluded_annotation_filter(all_annotations): | 561 def excluded_annotation_filter(all_annotations): |
559 if not self._excluded_annotations: | 562 if not self._excluded_annotations: |
560 return True | 563 return True |
561 return not any_annotation_matches(self._excluded_annotations, | 564 return not any_annotation_matches(self._excluded_annotations, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 def GenerateTestResults( | 642 def GenerateTestResults( |
640 result_code, result_bundle, statuses, start_ms, duration_ms): | 643 result_code, result_bundle, statuses, start_ms, duration_ms): |
641 return GenerateTestResults(result_code, result_bundle, statuses, | 644 return GenerateTestResults(result_code, result_bundle, statuses, |
642 start_ms, duration_ms) | 645 start_ms, duration_ms) |
643 | 646 |
644 #override | 647 #override |
645 def TearDown(self): | 648 def TearDown(self): |
646 if self._isolate_delegate: | 649 if self._isolate_delegate: |
647 self._isolate_delegate.Clear() | 650 self._isolate_delegate.Clear() |
648 | 651 |
OLD | NEW |