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 os | 8 import os |
9 import shutil | 9 import shutil |
10 import sys | 10 import sys |
(...skipping 27 matching lines...) Expand all Loading... |
38 print '@@@BUILD_STEP chromedriver2_python_tests@@@' | 38 print '@@@BUILD_STEP chromedriver2_python_tests@@@' |
39 cmd = [ | 39 cmd = [ |
40 sys.executable, | 40 sys.executable, |
41 os.path.join(_THIS_DIR, 'run_py_tests.py'), | 41 os.path.join(_THIS_DIR, 'run_py_tests.py'), |
42 '--chromedriver=' + chromedriver, | 42 '--chromedriver=' + chromedriver, |
43 '--chrome=' + chrome, | 43 '--chrome=' + chrome, |
44 ] | 44 ] |
45 if util.IsMac(): | 45 if util.IsMac(): |
46 # In Mac, chromedriver2.so is a 32-bit build, so run with the 32-bit python. | 46 # In Mac, chromedriver2.so is a 32-bit build, so run with the 32-bit python. |
47 os.environ['VERSIONER_PYTHON_PREFER_32_BIT'] = 'yes' | 47 os.environ['VERSIONER_PYTHON_PREFER_32_BIT'] = 'yes' |
48 if util.RunCommand(cmd): | 48 code = util.RunCommand(cmd) |
| 49 if code: |
49 print '@@@STEP_FAILURE@@@' | 50 print '@@@STEP_FAILURE@@@' |
| 51 return code |
50 | 52 |
51 | 53 |
52 def RunJavaTests(chromedriver, chrome): | 54 def RunJavaTests(chromedriver, chrome): |
53 print '@@@BUILD_STEP chromedriver2_java_tests@@@' | 55 print '@@@BUILD_STEP chromedriver2_java_tests@@@' |
54 cmd = [ | 56 cmd = [ |
55 sys.executable, | 57 sys.executable, |
56 os.path.join(_THIS_DIR, 'run_java_tests.py'), | 58 os.path.join(_THIS_DIR, 'run_java_tests.py'), |
57 '--chromedriver=' + chromedriver, | 59 '--chromedriver=' + chromedriver, |
58 '--chrome=' + chrome, | 60 '--chrome=' + chrome, |
59 ] | 61 ] |
60 if util.RunCommand(cmd): | 62 code = util.RunCommand(cmd) |
| 63 if code: |
61 print '@@@STEP_FAILURE@@@' | 64 print '@@@STEP_FAILURE@@@' |
| 65 return code |
62 | 66 |
63 | 67 |
64 def RunCppTests(cpp_tests): | 68 def RunCppTests(cpp_tests): |
65 print '@@@BUILD_STEP chromedriver2_tests@@@' | 69 print '@@@BUILD_STEP chromedriver2_tests@@@' |
66 if util.RunCommand([cpp_tests]): | 70 code = util.RunCommand([cpp_tests]) |
| 71 if code: |
67 print '@@@STEP_FAILURE@@@' | 72 print '@@@STEP_FAILURE@@@' |
| 73 return code |
68 | 74 |
69 | 75 |
70 def main(): | 76 def main(): |
71 chromedriver_map = { | 77 chromedriver_map = { |
72 'win': 'chromedriver2.dll', | 78 'win': 'chromedriver2.dll', |
73 'mac': 'chromedriver2.so', | 79 'mac': 'chromedriver2.so', |
74 'linux': 'libchromedriver2.so', | 80 'linux': 'libchromedriver2.so', |
75 } | 81 } |
76 chromedriver_name = chromedriver_map[util.GetPlatformName()] | 82 chromedriver_name = chromedriver_map[util.GetPlatformName()] |
77 | 83 |
(...skipping 26 matching lines...) Expand all Loading... |
104 _AddToolsToSystemPathForWindows() | 110 _AddToolsToSystemPathForWindows() |
105 | 111 |
106 code1 = RunPythonTests(chromedriver, chrome) | 112 code1 = RunPythonTests(chromedriver, chrome) |
107 code2 = RunJavaTests(chromedriver, chrome) | 113 code2 = RunJavaTests(chromedriver, chrome) |
108 code3 = RunCppTests(cpp_tests) | 114 code3 = RunCppTests(cpp_tests) |
109 return code1 or code2 or code3 | 115 return code1 or code2 or code3 |
110 | 116 |
111 | 117 |
112 if __name__ == '__main__': | 118 if __name__ == '__main__': |
113 sys.exit(main()) | 119 sys.exit(main()) |
OLD | NEW |