OLD | NEW |
1 #!/usr/bin/python2.6.2 | 1 #!/usr/bin/python2.6.2 |
2 # Copyright 2009, Google Inc. | 2 # Copyright 2009, Google Inc. |
3 # All rights reserved. | 3 # All rights reserved. |
4 # | 4 # |
5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
7 # met: | 7 # met: |
8 # | 8 # |
9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
(...skipping 11 matching lines...) Expand all Loading... |
22 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 22 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
23 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 23 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
24 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 24 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
25 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
26 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
27 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 | 30 |
31 | 31 |
32 """Defines common O3D test runner constants. This file determines paths to | 32 """Defines common O3D test runner constants. |
33 other O3D components relatively, so it must be placed in the right location. | |
34 | 33 |
35 """ | 34 """ |
36 | 35 |
37 import os | 36 import os |
38 import sys | 37 import sys |
39 | 38 |
40 import util | 39 import util |
41 | 40 |
42 join = os.path.join | 41 join = os.path.join |
43 | 42 |
44 # Make sure OS is supported. | 43 if util.IsWindows(): |
45 if not util.IsWindows() and not util.IsMac() and not util.IsLinux(): | 44 AUTO_PATH = r'C:\auto' |
| 45 PYTHON = r'C:\Python24\python.exe' |
| 46 if util.IsXP(): |
| 47 HOME_PATH = r'C:\Documents and Settings\testing' |
| 48 else: |
| 49 HOME_PATH = r'C:\Users\testing' |
| 50 |
| 51 elif util.IsMac(): |
| 52 AUTO_PATH = '/Users/testing/auto' |
| 53 PYTHON = 'python' |
| 54 HOME_PATH = '/Users/testing' |
| 55 |
| 56 elif util.IsLinux(): |
| 57 AUTO_PATH = '/home/testing/auto' |
| 58 PYTHON = 'python' |
| 59 HOME_PATH = '/home/testing' |
| 60 |
| 61 else: |
46 print 'Only Windows, Mac, and Linux are supported.' | 62 print 'Only Windows, Mac, and Linux are supported.' |
47 sys.exit(1) | 63 sys.exit(1) |
48 | 64 |
49 # This path should be root/o3d/tests. | 65 O3D_PATH = join(AUTO_PATH, 'o3d') |
50 TEST_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | 66 SCRIPTS_PATH = join(AUTO_PATH, 'scripts') |
51 # This path should be root/o3d. | 67 RESULTS_PATH = join(AUTO_PATH, 'results') |
52 O3D_PATH = os.path.dirname(TEST_PATH) | 68 SOFTWARE_PATH = join(AUTO_PATH, 'software') |
53 # This path should be root, i.e., the checkout location. | |
54 BASE_PATH = os.path.dirname(O3D_PATH) | |
55 | |
56 | |
57 HOME = os.path.expanduser('~') | |
58 if HOME == '~': | |
59 print 'Cannot find user home directory.' | |
60 sys.exit(1) | |
61 | |
62 if util.IsWindows(): | |
63 PYTHON = r'C:\Python24\python.exe' | |
64 else: | |
65 PYTHON = 'python' | |
66 | |
67 # Note: this path may or may not exist. | |
68 RESULTS_PATH = join(TEST_PATH, 'results') | |
69 | 69 |
70 # Build directories. | 70 # Build directories. |
71 if util.IsWindows(): | 71 if util.IsWindows(): |
72 BUILD_PATH = join(O3D_PATH, 'build') | 72 BUILD_PATH = join(O3D_PATH, 'o3d', 'build') |
73 elif util.IsMac(): | 73 elif util.IsMac(): |
74 BUILD_PATH = join(BASE_PATH, 'xcodebuild') | 74 BUILD_PATH = join(O3D_PATH, 'xcodebuild') |
75 else: | 75 else: |
76 BUILD_PATH = join(BASE_PATH, 'sconsbuild') | 76 BUILD_PATH = join(O3D_PATH, 'sconsbuild') |
77 | 77 |
78 if os.path.exists(join(BUILD_PATH, 'Debug')): | 78 if os.path.exists(join(BUILD_PATH, 'Debug')): |
79 PRODUCT_DIR_PATH = join(BUILD_PATH, 'Debug') | 79 PRODUCT_DIR_PATH = join(BUILD_PATH, 'Debug') |
80 elif os.path.exists(join(BUILD_PATH, 'Release')): | 80 else: |
81 PRODUCT_DIR_PATH = join(BUILD_PATH, 'Release') | 81 PRODUCT_DIR_PATH = join(BUILD_PATH, 'Release') |
82 else: | |
83 print 'Cannot find Debug or Release folder in ' + BUILD_PATH | |
84 sys.exit(1) | |
85 | 82 |
86 # Plugin locations. | 83 # Plugin locations. |
87 INSTALL_PATHS = [] | 84 INSTALL_PATHS = [] |
88 if util.IsWindows(): | 85 if util.IsWindows(): |
89 INSTALL_PATHS += [join(HOME, 'Application Data', 'Mozilla', | 86 INSTALL_PATHS += [join(HOME_PATH, 'Application Data', 'Mozilla', |
90 'plugins', 'npo3dautoplugin.dll')] | 87 'plugins', 'npo3dautoplugin.dll')] |
91 INSTALL_PATHS += [join(HOME, 'Application Data', 'Google', 'O3D', | 88 INSTALL_PATHS += [join(HOME_PATH, 'Application Data', 'Google', 'O3D', |
92 'o3d_host.dll')] | 89 'o3d_host.dll')] |
93 elif util.IsMac(): | 90 elif util.IsMac(): |
94 INSTALL_PATHS += ['/Library/Internet Plug-Ins/O3D.plugin'] | 91 INSTALL_PATHS += ['/Library/Internet Plug-Ins/O3D.plugin'] |
95 else: | 92 else: |
96 INSTALL_PATHS += [join(HOME, '.mozilla', 'plugins', | 93 INSTALL_PATHS += [join(HOME_PATH, '.mozilla', 'plugins', |
97 'libnpo3dautoplugin.so')] | 94 'libnpo3dautoplugin.so')] |
OLD | NEW |