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 """Setup for PyAuto functional tests. | 6 """Setup for PyAuto functional tests. |
7 | 7 |
8 Use the following in your scripts to run them standalone: | 8 Use the following in your scripts to run them standalone: |
9 | 9 |
10 # This should be at the top | 10 # This should be at the top |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 Note, this function will either return after doing nothing, or will exit with | 43 Note, this function will either return after doing nothing, or will exit with |
44 the subprocess's return code. | 44 the subprocess's return code. |
45 """ | 45 """ |
46 def RunAgain(): | 46 def RunAgain(): |
47 """Run the script again with the correct version of python. | 47 """Run the script again with the correct version of python. |
48 | 48 |
49 Note, this function does not return, but exits with the return code of the | 49 Note, this function does not return, but exits with the return code of the |
50 child. | 50 child. |
51 """ | 51 """ |
52 if sys.platform == 'cygwin' or sys.platform.startswith('win'): | 52 if sys.platform == 'cygwin' or sys.platform.startswith('win'): |
53 cmd = [os.path.join(pyauto_paths.GetThirdPartyDir(), 'python_26', | 53 cmd = [sys.executable] |
54 'python_slave.exe')] | |
55 elif sys.platform.startswith('darwin'): | 54 elif sys.platform.startswith('darwin'): |
56 # Arch runs the specified architecture of a universal binary. Run | 55 # Arch runs the specified architecture of a universal binary. Run |
57 # the 32 bit one. | 56 # the 32 bit one. |
58 cmd = ['arch', '-i386', 'python2.6'] | 57 cmd = ['arch', '-i386', 'python2.6'] |
59 elif sys.platform.startswith('linux'): | 58 elif sys.platform.startswith('linux'): |
60 cmd = ['python2.6'] | 59 cmd = ['python2.6'] |
61 | 60 |
62 cmd.extend(sys.argv) | 61 cmd.extend(sys.argv) |
63 print 'Running:', ' '.join(cmd) | 62 print 'Running:', ' '.join(cmd) |
64 proc = subprocess.Popen(cmd) | 63 proc = subprocess.Popen(cmd) |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 # Make scripts in this dir importable | 114 # Make scripts in this dir importable |
116 sys.path.append(os.path.dirname(__file__)) | 115 sys.path.append(os.path.dirname(__file__)) |
117 pyauto.Main.__init__(self) | 116 pyauto.Main.__init__(self) |
118 | 117 |
119 def TestsDir(self): | 118 def TestsDir(self): |
120 return os.path.dirname(__file__) | 119 return os.path.dirname(__file__) |
121 | 120 |
122 | 121 |
123 if __name__ == '__main__': | 122 if __name__ == '__main__': |
124 Main() | 123 Main() |
OLD | NEW |