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

Side by Side Diff: build/android/pylib/single_test_runner.py

Issue 11312239: Modify the Android test running scripts so they can be used from WebKit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 (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 import glob 5 import glob
6 import logging 6 import logging
7 import os 7 import os
8 import sys 8 import sys
9 9
10 from base_test_runner import BaseTestRunner 10 from base_test_runner import BaseTestRunner
(...skipping 17 matching lines...) Expand all
28 gtest_filter: A gtest_filter flag. 28 gtest_filter: A gtest_filter flag.
29 test_arguments: Additional arguments to pass to the test binary. 29 test_arguments: Additional arguments to pass to the test binary.
30 timeout: Timeout for each test. 30 timeout: Timeout for each test.
31 rebaseline: Whether or not to run tests in isolation and update the filter. 31 rebaseline: Whether or not to run tests in isolation and update the filter.
32 performance_test: Whether or not performance test(s). 32 performance_test: Whether or not performance test(s).
33 cleanup_test_files: Whether or not to cleanup test files on device. 33 cleanup_test_files: Whether or not to cleanup test files on device.
34 tool: Name of the Valgrind tool. 34 tool: Name of the Valgrind tool.
35 shard_index: index number of the shard on which the test suite will run. 35 shard_index: index number of the shard on which the test suite will run.
36 dump_debug_info: Whether or not to dump debug information. 36 dump_debug_info: Whether or not to dump debug information.
37 build_type: 'Release' or 'Debug'. 37 build_type: 'Release' or 'Debug'.
38 in_webkit_checkout: Whether the suite is being run from a WebKit checkout.
38 """ 39 """
39 40
40 def __init__(self, device, test_suite, gtest_filter, test_arguments, timeout, 41 def __init__(self, device, test_suite, gtest_filter, test_arguments, timeout,
41 rebaseline, performance_test, cleanup_test_files, tool_name, 42 rebaseline, performance_test, cleanup_test_files, tool_name,
42 shard_index, dump_debug_info, fast_and_loose, build_type): 43 shard_index, dump_debug_info, fast_and_loose, build_type,
44 in_webkit_checkout):
43 BaseTestRunner.__init__(self, device, tool_name, shard_index, build_type) 45 BaseTestRunner.__init__(self, device, tool_name, shard_index, build_type)
44 self._running_on_emulator = self.device.startswith('emulator') 46 self._running_on_emulator = self.device.startswith('emulator')
45 self._gtest_filter = gtest_filter 47 self._gtest_filter = gtest_filter
46 self._test_arguments = test_arguments 48 self._test_arguments = test_arguments
47 self.test_results = TestResults() 49 self.test_results = TestResults()
48 if dump_debug_info: 50 if dump_debug_info:
49 self.dump_debug_info = debug_info.GTestDebugInfo(self.adb, device, 51 self.dump_debug_info = debug_info.GTestDebugInfo(self.adb, device,
50 os.path.basename(test_suite), gtest_filter) 52 os.path.basename(test_suite), gtest_filter)
51 else: 53 else:
52 self.dump_debug_info = None 54 self.dump_debug_info = None
53 self.fast_and_loose = fast_and_loose 55 self.fast_and_loose = fast_and_loose
56 self.in_webkit_checkout = in_webkit_checkout
54 57
55 logging.warning('Test suite: ' + test_suite) 58 logging.warning('Test suite: ' + test_suite)
56 if os.path.splitext(test_suite)[1] == '.apk': 59 if os.path.splitext(test_suite)[1] == '.apk':
57 self.test_package = TestPackageApk(self.adb, device, 60 self.test_package = TestPackageApk(self.adb, device,
58 test_suite, timeout, rebaseline, performance_test, cleanup_test_files, 61 test_suite, timeout, rebaseline, performance_test, cleanup_test_files,
59 self.tool, self.dump_debug_info) 62 self.tool, self.dump_debug_info)
60 else: 63 else:
61 # Put a copy into the android out/target directory, to allow stack trace 64 # Put a copy into the android out/target directory, to allow stack trace
62 # generation. 65 # generation.
63 symbols_dir = os.path.join(constants.CHROME_DIR, 'out', build_type, 66 symbols_dir = os.path.join(constants.CHROME_DIR, 'out', build_type,
(...skipping 17 matching lines...) Expand all
81 """Returns the filename of gtest filter.""" 84 """Returns the filename of gtest filter."""
82 return os.path.join(sys.path[0], 'gtest_filter', 85 return os.path.join(sys.path[0], 'gtest_filter',
83 self.test_package.test_suite_basename + '_disabled') 86 self.test_package.test_suite_basename + '_disabled')
84 87
85 def _GetAdditionalEmulatorFilterName(self): 88 def _GetAdditionalEmulatorFilterName(self):
86 """Returns the filename of additional gtest filter for emulator.""" 89 """Returns the filename of additional gtest filter for emulator."""
87 return os.path.join(sys.path[0], 'gtest_filter', 90 return os.path.join(sys.path[0], 'gtest_filter',
88 self.test_package.test_suite_basename + 91 self.test_package.test_suite_basename +
89 '_emulator_additional_disabled') 92 '_emulator_additional_disabled')
90 93
94 def _PathToWebKitRoot(self):
95 """Returns the relative directory to the WebKit checkout, relative to
bulach 2012/11/15 01:06:39 needs to be one liner. """Returns the relative dir
Peter Beverloo 2012/11/15 12:11:29 Done.
96 Chrome's src/ directory."""
97 if self.in_webkit_checkout:
98 return os.path.join('..', '..', '..')
99 return os.path.join('third_party', 'WebKit')
100
91 def GetDisabledTests(self): 101 def GetDisabledTests(self):
92 """Returns a list of disabled tests. 102 """Returns a list of disabled tests.
93 103
94 Returns: 104 Returns:
95 A list of disabled tests obtained from gtest_filter/test_suite_disabled. 105 A list of disabled tests obtained from gtest_filter/test_suite_disabled.
96 """ 106 """
97 disabled_tests = run_tests_helper.GetExpectations(self._GetFilterFileName()) 107 disabled_tests = run_tests_helper.GetExpectations(self._GetFilterFileName())
98 if self._running_on_emulator: 108 if self._running_on_emulator:
99 # Append emulator's filter file. 109 # Append emulator's filter file.
100 disabled_tests.extend(run_tests_helper.GetExpectations( 110 disabled_tests.extend(run_tests_helper.GetExpectations(
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 return [ 231 return [
222 'chrome/test/data/dromaeo', 232 'chrome/test/data/dromaeo',
223 'chrome/test/data/json2.js', 233 'chrome/test/data/json2.js',
224 'chrome/test/data/sunspider', 234 'chrome/test/data/sunspider',
225 'chrome/test/data/v8_benchmark', 235 'chrome/test/data/v8_benchmark',
226 'chrome/test/perf/sunspider_uitest.js', 236 'chrome/test/perf/sunspider_uitest.js',
227 'chrome/test/perf/v8_benchmark_uitest.js', 237 'chrome/test/perf/v8_benchmark_uitest.js',
228 ] 238 ]
229 elif self.test_package.test_suite_basename == 'webkit_unit_tests': 239 elif self.test_package.test_suite_basename == 'webkit_unit_tests':
230 return [ 240 return [
231 'third_party/WebKit/Source/WebKit/chromium/tests/data', 241 ['%s/Source/WebKit/chromium/tests/data' % self._PathToWebKitRoot(),
242 'third_party/Source/WebKit/chromium/tests/data']
bulach 2012/11/15 01:06:39 ahn, I see... yeah, it seems entirely the wrong le
Peter Beverloo 2012/11/15 12:11:29 Done, I've now put this in a method under StripAnd
232 ] 243 ]
233 elif self.test_package.test_suite_basename == 'content_unittests': 244 elif self.test_package.test_suite_basename == 'content_unittests':
234 return [ 245 return [
235 'content/test/data/gpu/webgl_conformance_test_expectations.txt', 246 'content/test/data/gpu/webgl_conformance_test_expectations.txt',
236 'net/data/ssl/certificates/', 247 'net/data/ssl/certificates/',
237 'webkit/data/dom_storage/webcore_test_database.localstorage', 248 'webkit/data/dom_storage/webcore_test_database.localstorage',
238 'third_party/hyphen/hyph_en_US.dic', 249 'third_party/hyphen/hyph_en_US.dic',
239 ] 250 ]
240 elif self.test_package.test_suite_basename == 'media_unittests': 251 elif self.test_package.test_suite_basename == 'media_unittests':
241 return [ 252 return [
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 self.tool.CleanUpEnvironment() 361 self.tool.CleanUpEnvironment()
351 if self.test_package.cleanup_test_files: 362 if self.test_package.cleanup_test_files:
352 self.adb.RemovePushedFiles() 363 self.adb.RemovePushedFiles()
353 if self.dump_debug_info: 364 if self.dump_debug_info:
354 self.dump_debug_info.StopRecordingLog() 365 self.dump_debug_info.StopRecordingLog()
355 if self._performance_test_setup: 366 if self._performance_test_setup:
356 self._performance_test_setup.TearDown() 367 self._performance_test_setup.TearDown()
357 if self.dump_debug_info: 368 if self.dump_debug_info:
358 self.dump_debug_info.ArchiveNewCrashFiles() 369 self.dump_debug_info.ArchiveNewCrashFiles()
359 super(SingleTestRunner, self).TearDown() 370 super(SingleTestRunner, self).TearDown()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698