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

Side by Side Diff: build/android/pylib/host_driven/test_case.py

Issue 22903016: [android] Adds constants.GetOutDirectory() and converts test scripts to use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update adb_install_apk.py Created 7 years, 4 months 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 | Annotate | Revision Log
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 """Base class for host-driven test cases. 5 """Base class for host-driven test cases.
6 6
7 This test case is intended to serve as the base class for any host-driven 7 This test case is intended to serve as the base class for any host-driven
8 test cases. It is similar to the Python unitttest module in that test cases 8 test cases. It is similar to the Python unitttest module in that test cases
9 inherit from this class and add methods which will be run as tests. 9 inherit from this class and add methods which will be run as tests.
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 cleanup_test_files): 60 cleanup_test_files):
61 self.device_id = device 61 self.device_id = device
62 self.shard_index = shard_index 62 self.shard_index = shard_index
63 self.adb = android_commands.AndroidCommands(self.device_id) 63 self.adb = android_commands.AndroidCommands(self.device_id)
64 self.push_deps = push_deps 64 self.push_deps = push_deps
65 self.cleanup_test_files = cleanup_test_files 65 self.cleanup_test_files = cleanup_test_files
66 66
67 def TearDown(self): 67 def TearDown(self):
68 pass 68 pass
69 69
70 # TODO(craigdh): Remove GetOutDir once references have been removed
71 # downstream.
70 def GetOutDir(self): 72 def GetOutDir(self):
71 return os.path.join(os.environ['CHROME_SRC'], 'out', 73 return constants.GetBuildDirectory()
72 constants.GetBuildType())
73 74
74 def Run(self): 75 def Run(self):
75 logging.info('Running host-driven test: %s', self.tagged_name) 76 logging.info('Running host-driven test: %s', self.tagged_name)
76 # Get the test method on the derived class and execute it 77 # Get the test method on the derived class and execute it
77 return getattr(self, self.test_name)() 78 return getattr(self, self.test_name)()
78 79
79 def __RunJavaTest(self, package_name, test_case, test_method): 80 def __RunJavaTest(self, package_name, test_case, test_method):
80 """Runs a single Java test method with a Java TestRunner. 81 """Runs a single Java test method with a Java TestRunner.
81 82
82 Args: 83 Args:
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 overall_result.AddResult( 143 overall_result.AddResult(
143 test_result.InstrumentationTestResult( 144 test_result.InstrumentationTestResult(
144 self.tagged_name, test_type, start_ms, duration_ms, log=log)) 145 self.tagged_name, test_type, start_ms, duration_ms, log=log))
145 return overall_result 146 return overall_result
146 147
147 def __str__(self): 148 def __str__(self):
148 return self.tagged_name 149 return self.tagged_name
149 150
150 def __repr__(self): 151 def __repr__(self):
151 return self.tagged_name 152 return self.tagged_name
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698