Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / build / android / pylib / linker / setup.py
blob5776f5af33555bcab98cc9150fc3b6e5e02770e6
1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 """Setup for linker tests."""
7 import os
8 import sys
10 from pylib import constants
11 from pylib.linker import test_case
12 from pylib.linker import test_runner
14 sys.path.insert(0,
15 os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib',
16 'common'))
17 import unittest_util # pylint: disable=F0401
19 def Setup(args, _devices):
20 """Creates a list of test cases and a runner factory.
22 Args:
23 args: an argparse.Namespace object.
24 Returns:
25 A tuple of (TestRunnerFactory, tests).
26 """
27 test_cases = [
28 test_case.LinkerLibraryAddressTest,
29 test_case.LinkerSharedRelroTest,
30 test_case.LinkerRandomizationTest]
32 low_memory_modes = [False, True]
33 all_tests = [t(is_low_memory=m) for t in test_cases for m in low_memory_modes]
35 if args.test_filter:
36 all_test_names = [test.qualified_name for test in all_tests]
37 filtered_test_names = unittest_util.FilterTestNames(all_test_names,
38 args.test_filter)
39 all_tests = [t for t in all_tests \
40 if t.qualified_name in filtered_test_names]
42 def TestRunnerFactory(device, _shard_index):
43 return test_runner.LinkerTestRunner(device, args.tool)
45 return (TestRunnerFactory, all_tests)