OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 sys | 10 import sys |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 if code: | 89 if code: |
90 print '@@@STEP_FAILURE@@@' | 90 print '@@@STEP_FAILURE@@@' |
91 return code | 91 return code |
92 | 92 |
93 | 93 |
94 def main(): | 94 def main(): |
95 parser = optparse.OptionParser() | 95 parser = optparse.OptionParser() |
96 parser.add_option( | 96 parser.add_option( |
97 '', '--android-package', | 97 '', '--android-package', |
98 help='Application package name, if running tests on Android.') | 98 help='Application package name, if running tests on Android.') |
99 parser.add_option( | |
100 '', '--chrome-version', | |
101 help='Version of chrome, e.g., \'HEAD\', \'27\', or \'26\'.' | |
102 'Default is to run tests against all of these versions.') | |
kkania
2013/04/08 23:34:21
Maybe add something in comment about this only ref
chrisgao (Use stgao instead)
2013/04/08 23:52:54
Done.
| |
99 options, _ = parser.parse_args() | 103 options, _ = parser.parse_args() |
100 | 104 |
101 chromedriver_map = { | 105 chromedriver_map = { |
102 'win': 'chromedriver2.dll', | 106 'win': 'chromedriver2.dll', |
103 'mac': 'chromedriver2.so', | 107 'mac': 'chromedriver2.so', |
104 'linux': 'libchromedriver2.so', | 108 'linux': 'libchromedriver2.so', |
105 } | 109 } |
106 chromedriver_name = chromedriver_map[util.GetPlatformName()] | 110 chromedriver_name = chromedriver_map[util.GetPlatformName()] |
107 | 111 |
108 chrome_map = { | 112 chrome_map = { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
142 android_package=options.android_package) | 146 android_package=options.android_package) |
143 code2 = RunJavaTests(chromedriver_server, | 147 code2 = RunJavaTests(chromedriver_server, |
144 android_package=options.android_package) | 148 android_package=options.android_package) |
145 return code1 or code2 | 149 return code1 or code2 |
146 else: | 150 else: |
147 chrome_tip_of_tree = os.path.join(build_dir, chrome_name) | 151 chrome_tip_of_tree = os.path.join(build_dir, chrome_name) |
148 cpp_tests = os.path.join(build_dir, cpp_tests_name) | 152 cpp_tests = os.path.join(build_dir, cpp_tests_name) |
149 | 153 |
150 chrome_26 = continuous_archive.DownloadChrome( | 154 chrome_26 = continuous_archive.DownloadChrome( |
151 continuous_archive.CHROME_26_REVISION, util.MakeTempDir()) | 155 continuous_archive.CHROME_26_REVISION, util.MakeTempDir()) |
156 chrome_27 = continuous_archive.DownloadChrome( | |
157 continuous_archive.CHROME_27_REVISION, util.MakeTempDir()) | |
152 chrome_path_versions = [ | 158 chrome_path_versions = [ |
153 {'path': chrome_tip_of_tree, 'version': 'HEAD'}, | 159 {'path': chrome_tip_of_tree, 'version': 'HEAD'}, |
160 {'path': chrome_27, 'version': '27'}, | |
154 {'path': chrome_26, 'version': '26'}, | 161 {'path': chrome_26, 'version': '26'}, |
155 ] | 162 ] |
156 code = 0 | 163 code = 0 |
157 for chrome in chrome_path_versions: | 164 for chrome in chrome_path_versions: |
165 if options.chrome_version and chrome['version'] != options.chrome_version: | |
166 continue | |
167 | |
158 code1 = RunPythonTests(chromedriver, chrome=chrome['path'], | 168 code1 = RunPythonTests(chromedriver, chrome=chrome['path'], |
159 chrome_version=chrome['version']) | 169 chrome_version=chrome['version']) |
160 code2 = RunJavaTests(chromedriver_server, chrome=chrome['path'], | 170 code2 = RunJavaTests(chromedriver_server, chrome=chrome['path'], |
161 chrome_version=chrome['version']) | 171 chrome_version=chrome['version']) |
162 code = code or code1 or code2 | 172 code = code or code1 or code2 |
163 return RunCppTests(cpp_tests) or code | 173 return RunCppTests(cpp_tests) or code |
164 | 174 |
165 | 175 |
166 if __name__ == '__main__': | 176 if __name__ == '__main__': |
167 sys.exit(main()) | 177 sys.exit(main()) |
OLD | NEW |