Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: build/android/pylib/linker/setup.py

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/android/pylib/junit/test_runner.py ('k') | build/android/pylib/perf/perf_control.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 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 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 """Setup for linker tests.""" 5 """Setup for linker tests."""
6 6
7 import os 7 import os
8 import sys 8 import sys
9 9
10 from pylib import constants 10 from pylib import constants
11 from pylib.linker import test_case 11 from pylib.linker import test_case
12 from pylib.linker import test_runner 12 from pylib.linker import test_runner
13 13
14 sys.path.insert(0, 14 sys.path.insert(0,
15 os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', 15 os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib',
16 'common')) 16 'common'))
17 import unittest_util # pylint: disable=F0401 17 import unittest_util # pylint: disable=F0401
18 18
19 def Setup(options, _devices): 19 def Setup(args, _devices):
20 """Creates a list of test cases and a runner factory. 20 """Creates a list of test cases and a runner factory.
21 21
22 Args:
23 args: an argparse.Namespace object.
22 Returns: 24 Returns:
23 A tuple of (TestRunnerFactory, tests). 25 A tuple of (TestRunnerFactory, tests).
24 """ 26 """
25 test_cases = [ 27 test_cases = [
26 test_case.LinkerLibraryAddressTest, 28 test_case.LinkerLibraryAddressTest,
27 test_case.LinkerSharedRelroTest, 29 test_case.LinkerSharedRelroTest,
28 test_case.LinkerRandomizationTest] 30 test_case.LinkerRandomizationTest]
29 31
30 low_memory_modes = [False, True] 32 low_memory_modes = [False, True]
31 all_tests = [t(is_low_memory=m) for t in test_cases for m in low_memory_modes] 33 all_tests = [t(is_low_memory=m) for t in test_cases for m in low_memory_modes]
32 34
33 if options.test_filter: 35 if args.test_filter:
34 all_test_names = [test.qualified_name for test in all_tests] 36 all_test_names = [test.qualified_name for test in all_tests]
35 filtered_test_names = unittest_util.FilterTestNames(all_test_names, 37 filtered_test_names = unittest_util.FilterTestNames(all_test_names,
36 options.test_filter) 38 args.test_filter)
37 all_tests = [t for t in all_tests \ 39 all_tests = [t for t in all_tests \
38 if t.qualified_name in filtered_test_names] 40 if t.qualified_name in filtered_test_names]
39 41
40 def TestRunnerFactory(device, _shard_index): 42 def TestRunnerFactory(device, _shard_index):
41 return test_runner.LinkerTestRunner( 43 return test_runner.LinkerTestRunner(
42 device, options.tool, options.cleanup_test_files) 44 device, args.tool, args.cleanup_test_files)
43 45
44 return (TestRunnerFactory, all_tests) 46 return (TestRunnerFactory, all_tests)
OLDNEW
« no previous file with comments | « build/android/pylib/junit/test_runner.py ('k') | build/android/pylib/perf/perf_control.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698