OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Runs all ChromeDriver end to end tests.""" | 6 """Runs all ChromeDriver end to end tests.""" |
7 | 7 |
8 import optparse | 8 import optparse |
9 import os | 9 import os |
10 import platform | 10 import platform |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 chrome=chrome, | 100 chrome=chrome, |
101 chrome_version=chrome_version, | 101 chrome_version=chrome_version, |
102 android_package=android_package, | 102 android_package=android_package, |
103 verbose=verbose)) | 103 verbose=verbose)) |
104 if code: | 104 if code: |
105 util.MarkBuildStepError() | 105 util.MarkBuildStepError() |
106 return code | 106 return code |
107 | 107 |
108 | 108 |
109 def RunCppTests(cpp_tests): | 109 def RunCppTests(cpp_tests): |
110 util.MarkBuildStepStart('chromedriver2_tests') | 110 util.MarkBuildStepStart('chromedriver_tests') |
111 code = util.RunCommand([cpp_tests]) | 111 code = util.RunCommand([cpp_tests]) |
112 if code: | 112 if code: |
113 util.MarkBuildStepError() | 113 util.MarkBuildStepError() |
114 return code | 114 return code |
115 | 115 |
116 | 116 |
117 def DownloadChrome(version_name, revision, download_site): | 117 def DownloadChrome(version_name, revision, download_site): |
118 util.MarkBuildStepStart('download %s' % version_name) | 118 util.MarkBuildStepStart('download %s' % version_name) |
119 return archive.DownloadChrome(revision, util.MakeTempDir(), download_site) | 119 return archive.DownloadChrome(revision, util.MakeTempDir(), download_site) |
120 | 120 |
121 | 121 |
122 def main(): | 122 def main(): |
123 parser = optparse.OptionParser() | 123 parser = optparse.OptionParser() |
124 parser.add_option( | 124 parser.add_option( |
125 '', '--android-packages', | 125 '', '--android-packages', |
126 help='Comma separated list of application package names, ' | 126 help='Comma separated list of application package names, ' |
127 'if running tests on Android.') | 127 'if running tests on Android.') |
128 # Option 'chrome-version' is for desktop only. | 128 # Option 'chrome-version' is for desktop only. |
129 parser.add_option( | 129 parser.add_option( |
130 '', '--chrome-version', | 130 '', '--chrome-version', |
131 help='Version of chrome, e.g., \'HEAD\', \'27\', or \'26\'.' | 131 help='Version of chrome, e.g., \'HEAD\', \'27\', or \'26\'.' |
132 'Default is to run tests against all of these versions.' | 132 'Default is to run tests against all of these versions.' |
133 'Notice: this option only applies to desktop.') | 133 'Notice: this option only applies to desktop.') |
134 options, _ = parser.parse_args() | 134 options, _ = parser.parse_args() |
135 | 135 |
136 exe_postfix = '' | 136 exe_postfix = '' |
137 if util.IsWindows(): | 137 if util.IsWindows(): |
138 exe_postfix = '.exe' | 138 exe_postfix = '.exe' |
139 cpp_tests_name = 'chromedriver2_tests' + exe_postfix | 139 cpp_tests_name = 'chromedriver_tests' + exe_postfix |
140 server_name = 'chromedriver2_server' + exe_postfix | 140 server_name = 'chromedriver' + exe_postfix |
141 | 141 |
142 required_build_outputs = [server_name] | 142 required_build_outputs = [server_name] |
143 if not options.android_packages: | 143 if not options.android_packages: |
144 required_build_outputs += [cpp_tests_name] | 144 required_build_outputs += [cpp_tests_name] |
145 build_dir = chrome_paths.GetBuildDir(required_build_outputs) | 145 build_dir = chrome_paths.GetBuildDir(required_build_outputs) |
146 constants.SetBuildType(os.path.basename(build_dir)) | 146 constants.SetBuildType(os.path.basename(build_dir)) |
147 print 'Using build outputs from', build_dir | 147 print 'Using build outputs from', build_dir |
148 | 148 |
149 chromedriver = os.path.join(build_dir, server_name) | 149 chromedriver = os.path.join(build_dir, server_name) |
150 platform_name = util.GetPlatformName() | 150 platform_name = util.GetPlatformName() |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 code2 = RunJavaTests(chromedriver, chrome=chrome_path, | 205 code2 = RunJavaTests(chromedriver, chrome=chrome_path, |
206 chrome_version=version[0], | 206 chrome_version=version[0], |
207 chrome_version_name='v%s' % version_name) | 207 chrome_version_name='v%s' % version_name) |
208 code = code or code1 or code2 | 208 code = code or code1 or code2 |
209 cpp_tests = os.path.join(build_dir, cpp_tests_name) | 209 cpp_tests = os.path.join(build_dir, cpp_tests_name) |
210 return RunCppTests(cpp_tests) or code | 210 return RunCppTests(cpp_tests) or code |
211 | 211 |
212 | 212 |
213 if __name__ == '__main__': | 213 if __name__ == '__main__': |
214 sys.exit(main()) | 214 sys.exit(main()) |
OLD | NEW |