| OLD | NEW |
| 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 """Module containing information about the host-driven tests.""" | 5 """Module containing information about the host-driven tests.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import sys | 9 import sys |
| 10 | 10 |
| 11 from pylib.host_driven import tests_annotations | 11 from pylib.host_driven import tests_annotations |
| 12 | 12 |
| 13 from pylib import constants | 13 from pylib import constants |
| 14 | 14 |
| 15 sys.path.insert(0, | 15 sys.path.insert(0, |
| 16 os.path.join(constants.DIR_SOURCE_ROOT, | 16 os.path.join(constants.DIR_SOURCE_ROOT, |
| 17 'build', 'util', 'lib', 'common')) | 17 'build', 'util', 'lib', 'common')) |
| 18 | 18 |
| 19 import unittest_util | 19 import unittest_util # pylint: disable=F0401 |
| 20 | 20 |
| 21 class TestInfo(object): | 21 class TestInfo(object): |
| 22 """An object containing and representing a test function, plus metadata.""" | 22 """An object containing and representing a test function, plus metadata.""" |
| 23 | 23 |
| 24 def __init__(self, runnable, set_up=None, tear_down=None): | 24 def __init__(self, runnable, set_up=None, tear_down=None): |
| 25 # The actual test function/method. | 25 # The actual test function/method. |
| 26 self.runnable = runnable | 26 self.runnable = runnable |
| 27 # Qualified name of test function/method (e.g. FooModule.testBar). | 27 # Qualified name of test function/method (e.g. FooModule.testBar). |
| 28 self.qualified_name = self._GetQualifiedName(runnable) | 28 self.qualified_name = self._GetQualifiedName(runnable) |
| 29 # setUp and teardown functions, if any. | 29 # setUp and teardown functions, if any. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 value_list = filters[1].split(',') | 135 value_list = filters[1].split(',') |
| 136 for value in value_list: | 136 for value in value_list: |
| 137 if tests_annotations.AnnotatedFunctions.IsAnnotated( | 137 if tests_annotations.AnnotatedFunctions.IsAnnotated( |
| 138 key + ':' + value, test_info.qualified_name): | 138 key + ':' + value, test_info.qualified_name): |
| 139 return True | 139 return True |
| 140 elif tests_annotations.AnnotatedFunctions.IsAnnotated( | 140 elif tests_annotations.AnnotatedFunctions.IsAnnotated( |
| 141 annotation_filter, test_info.qualified_name): | 141 annotation_filter, test_info.qualified_name): |
| 142 return True | 142 return True |
| 143 return False | 143 return False |
| 144 | 144 |
| OLD | NEW |