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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 # when chromedriver2.so is not a static build. | 67 # when chromedriver2.so is not a static build. |
68 _AppendEnvironmentPath('LD_LIBRARY_PATH', os.path.join(build_dir, 'lib')) | 68 _AppendEnvironmentPath('LD_LIBRARY_PATH', os.path.join(build_dir, 'lib')) |
69 elif util.IsWindows(): | 69 elif util.IsWindows(): |
70 # For Windows bots: add ant, java(jre) and the like to system path. | 70 # For Windows bots: add ant, java(jre) and the like to system path. |
71 _AddToolsToSystemPathForWindows() | 71 _AddToolsToSystemPathForWindows() |
72 | 72 |
73 # Run python test for chromedriver. | 73 # Run python test for chromedriver. |
74 print '@@@BUILD_STEP chromedriver2_python_tests@@@' | 74 print '@@@BUILD_STEP chromedriver2_python_tests@@@' |
75 cmd = [ | 75 cmd = [ |
76 sys.executable, | 76 sys.executable, |
77 os.path.join(_THIS_DIR, 'test.py'), | 77 os.path.join(_THIS_DIR, 'run_py_tests.py'), |
78 os.path.join(build_dir, chromedriver), | 78 '--chromedriver=' + os.path.join(build_dir, chromedriver), |
79 ] | 79 ] |
80 # Set the built chrome binary. | 80 # Set the built chrome binary. |
81 if chrome_binary is not None: | 81 if chrome_binary is not None: |
82 cmd.append(chrome_binary) | 82 cmd.append('--chrome=' + chrome_binary) |
83 if util.IsMac(): | 83 if util.IsMac(): |
84 # In Mac, chromedriver2.so is a 32-bit build, so run with the 32-bit python. | 84 # In Mac, chromedriver2.so is a 32-bit build, so run with the 32-bit python. |
85 os.environ['VERSIONER_PYTHON_PREFER_32_BIT'] = 'yes' | 85 os.environ['VERSIONER_PYTHON_PREFER_32_BIT'] = 'yes' |
86 code1 = util.RunCommand(cmd) | 86 code1 = util.RunCommand(cmd) |
87 if code1 != 0: | 87 if code1 != 0: |
88 print '@@@STEP_FAILURE@@@' | 88 print '@@@STEP_FAILURE@@@' |
89 | 89 |
90 # Run java tests for chromedriver. | 90 # Run java tests for chromedriver. |
91 print '@@@BUILD_STEP chromedriver2_java_tests@@@' | 91 print '@@@BUILD_STEP chromedriver2_java_tests@@@' |
92 cmd = [ | 92 cmd = [ |
93 sys.executable, | 93 sys.executable, |
94 os.path.join(_THIS_DIR, 'run_java_tests.py'), | 94 os.path.join(_THIS_DIR, 'run_java_tests.py'), |
95 '--chromedriver_path=' + os.path.join(build_dir, chromedriver), | 95 '--chromedriver=' + os.path.join(build_dir, chromedriver), |
96 ] | 96 ] |
97 # Set the built chrome binary. | 97 # Set the built chrome binary. |
98 if chrome_binary is not None: | 98 if chrome_binary is not None: |
99 cmd.append('--chrome_path=' + chrome_binary) | 99 cmd.append('--chrome=' + chrome_binary) |
100 code2 = util.RunCommand(cmd) | 100 code2 = util.RunCommand(cmd) |
101 if code2 != 0: | 101 if code2 != 0: |
102 print '@@@STEP_FAILURE@@@' | 102 print '@@@STEP_FAILURE@@@' |
103 | 103 |
104 return code1 or code2 | 104 return code1 or code2 |
105 | 105 |
106 | 106 |
107 if __name__ == '__main__': | 107 if __name__ == '__main__': |
108 sys.exit(Main()) | 108 sys.exit(Main()) |
OLD | NEW |