Index: build/android/pylib/linker/setup.py |
diff --git a/build/android/pylib/linker/setup.py b/build/android/pylib/linker/setup.py |
index 029be05e13cdbcf43792800c7aa68c072bd03aba..a13ea4d78b27315311e126e31170d4aa79308e69 100644 |
--- a/build/android/pylib/linker/setup.py |
+++ b/build/android/pylib/linker/setup.py |
@@ -4,7 +4,6 @@ |
"""Setup for linker tests.""" |
-import logging |
import os |
import sys |
import types |
@@ -12,6 +11,12 @@ import types |
import test_case |
import test_runner |
+from pylib import constants |
+ |
+sys.path.insert(0, |
+ os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', |
+ 'common')) |
+import unittest_util |
def Setup(options, devices): |
"""Creates a list of test cases and a runner factory. |
@@ -19,12 +24,20 @@ def Setup(options, devices): |
Returns: |
A tuple of (TestRunnerFactory, tests). |
""" |
- |
- all_tests = [ |
- test_case.LinkerTestCase('ForRegularDevice', |
- is_low_memory=False), |
- test_case.LinkerTestCase('ForLowMemoryDevice', |
- is_low_memory=True) ] |
+ test_cases = [ |
+ test_case.LinkerLibraryAddressTest, |
+ test_case.LinkerSharedRelroTest, |
+ test_case.LinkerRandomizationTest ] |
+ |
+ low_memory_modes = [False, True] |
+ all_tests = [t(is_low_memory=m) for t in test_cases for m in low_memory_modes] |
+ |
+ if options.test_filter: |
+ all_test_names = [ test.qualified_name for test in all_tests ] |
+ filtered_test_names = unittest_util.FilterTestNames(all_test_names, |
+ options.test_filter) |
+ all_tests = [t for t in all_tests \ |
+ if t.qualified_name in filtered_test_names] |
def TestRunnerFactory(device, shard_index): |
return test_runner.LinkerTestRunner( |