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

Side by Side Diff: build/android/pylib/gtest/test_package_exe.py

Issue 333933003: [Android] Switch to DeviceUtils version of RunShellCommand. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 6 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
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """Defines TestPackageExecutable to help run stand-alone executables.""" 5 """Defines TestPackageExecutable to help run stand-alone executables."""
6 6
7 import logging 7 import logging
8 import os 8 import os
9 import sys 9 import sys
10 import tempfile 10 import tempfile
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 cmd_helper.RunCmd(['chmod', '+x', sh_script_file.name]) 99 cmd_helper.RunCmd(['chmod', '+x', sh_script_file.name])
100 device.old_interface.PushIfNeeded( 100 device.old_interface.PushIfNeeded(
101 sh_script_file.name, 101 sh_script_file.name,
102 constants.TEST_EXECUTABLE_DIR + '/chrome_test_runner.sh') 102 constants.TEST_EXECUTABLE_DIR + '/chrome_test_runner.sh')
103 logging.info('Conents of the test runner script: ') 103 logging.info('Conents of the test runner script: ')
104 for line in open(sh_script_file.name).readlines(): 104 for line in open(sh_script_file.name).readlines():
105 logging.info(' ' + line.rstrip()) 105 logging.info(' ' + line.rstrip())
106 106
107 #override 107 #override
108 def GetAllTests(self, device): 108 def GetAllTests(self, device):
109 all_tests = device.old_interface.RunShellCommand( 109 all_tests = device.RunShellCommand(
110 '%s %s/%s --gtest_list_tests' % 110 '%s %s/%s --gtest_list_tests' %
111 (self.tool.GetTestWrapper(), 111 (self.tool.GetTestWrapper(),
112 constants.TEST_EXECUTABLE_DIR, 112 constants.TEST_EXECUTABLE_DIR,
113 self.suite_name)) 113 self.suite_name))
114 return self._ParseGTestListTests(all_tests) 114 return self._ParseGTestListTests(all_tests)
115 115
116 #override 116 #override
117 def SpawnTestProcess(self, device): 117 def SpawnTestProcess(self, device):
118 args = ['adb', '-s', device.old_interface.GetDevice(), 'shell', 'sh', 118 args = ['adb', '-s', device.old_interface.GetDevice(), 'shell', 'sh',
119 constants.TEST_EXECUTABLE_DIR + '/chrome_test_runner.sh'] 119 constants.TEST_EXECUTABLE_DIR + '/chrome_test_runner.sh']
(...skipping 14 matching lines...) Expand all
134 source_mtime = os.stat(self.suite_path).st_mtime 134 source_mtime = os.stat(self.suite_path).st_mtime
135 if target_mtime < source_mtime: 135 if target_mtime < source_mtime:
136 raise Exception( 136 raise Exception(
137 'stripped binary (%s, timestamp %d) older than ' 137 'stripped binary (%s, timestamp %d) older than '
138 'source binary (%s, timestamp %d), build target %s' % 138 'source binary (%s, timestamp %d), build target %s' %
139 (target_name, target_mtime, self.suite_path, source_mtime, 139 (target_name, target_mtime, self.suite_path, source_mtime,
140 self.suite_name + '_stripped')) 140 self.suite_name + '_stripped'))
141 141
142 test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.suite_name 142 test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.suite_name
143 device.old_interface.PushIfNeeded(target_name, test_binary) 143 device.old_interface.PushIfNeeded(target_name, test_binary)
OLDNEW
« no previous file with comments | « build/android/pylib/gtest/test_package_apk.py ('k') | build/android/pylib/instrumentation/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698