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

Side by Side Diff: build/android/pylib/junit/test_runner.py

Issue 775863004: Revert "[Android] Switch b/a/test_runner.py from optparse to argparse." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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/setup.py ('k') | build/android/pylib/linker/setup.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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 os 5 import os
6 6
7 from pylib import cmd_helper 7 from pylib import cmd_helper
8 from pylib import constants 8 from pylib import constants
9 9
10 class JavaTestRunner(object): 10 class JavaTestRunner(object):
11 """Runs java tests on the host.""" 11 """Runs java tests on the host."""
12 12
13 def __init__(self, args): 13 def __init__(self, options):
14 self._package_filter = args.package_filter 14 self._package_filter = options.package_filter
15 self._runner_filter = args.runner_filter 15 self._runner_filter = options.runner_filter
16 self._sdk_version = args.sdk_version 16 self._sdk_version = options.sdk_version
17 self._test_filter = args.test_filter 17 self._test_filter = options.test_filter
18 self._test_suite = args.test_suite 18 self._test_suite = options.test_suite
19 19
20 def SetUp(self): 20 def SetUp(self):
21 pass 21 pass
22 22
23 def RunTest(self, _test): 23 def RunTest(self, _test):
24 """Runs junit tests from |self._test_suite|.""" 24 """Runs junit tests from |self._test_suite|."""
25 command = ['java', 25 command = ['java',
26 '-jar', os.path.join(constants.GetOutDirectory(), 'lib.java', 26 '-jar', os.path.join(constants.GetOutDirectory(), 'lib.java',
27 '%s.jar' % self._test_suite)] 27 '%s.jar' % self._test_suite)]
28 if self._test_filter: 28 if self._test_filter:
29 command.extend(['-gtest-filter', self._test_filter]) 29 command.extend(['-gtest-filter', self._test_filter])
30 if self._package_filter: 30 if self._package_filter:
31 command.extend(['-package-filter', self._package_filter]) 31 command.extend(['-package-filter', self._package_filter])
32 if self._runner_filter: 32 if self._runner_filter:
33 command.extend(['-runner-filter', self._runner_filter]) 33 command.extend(['-runner-filter', self._runner_filter])
34 if self._sdk_version: 34 if self._sdk_version:
35 command.extend(['-sdk-version', self._sdk_version]) 35 command.extend(['-sdk-version', self._sdk_version])
36 return cmd_helper.RunCmd(command) 36 return cmd_helper.RunCmd(command)
37 37
38 def TearDown(self): 38 def TearDown(self):
39 pass 39 pass
40 40
OLDNEW
« no previous file with comments | « build/android/pylib/junit/setup.py ('k') | build/android/pylib/linker/setup.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698