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. | 32 """Defines common O3D test runner constants. This file determines paths to |
| 33 other O3D components relatively, so it must be placed in the right location. |
33 | 34 |
34 """ | 35 """ |
35 | 36 |
36 import os | 37 import os |
37 import sys | 38 import sys |
38 | 39 |
39 import util | 40 import util |
40 | 41 |
41 join = os.path.join | 42 join = os.path.join |
42 | 43 |
43 if util.IsWindows(): | 44 # Make sure OS is supported. |
44 AUTO_PATH = r'C:\auto' | 45 if not util.IsWindows() and not util.IsMac() and not util.IsLinux(): |
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: | |
62 print 'Only Windows, Mac, and Linux are supported.' | 46 print 'Only Windows, Mac, and Linux are supported.' |
63 sys.exit(1) | 47 sys.exit(1) |
64 | 48 |
65 O3D_PATH = join(AUTO_PATH, 'o3d') | 49 # This path should be root/o3d/tests. |
66 SCRIPTS_PATH = join(AUTO_PATH, 'scripts') | 50 TEST_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
67 RESULTS_PATH = join(AUTO_PATH, 'results') | 51 # This path should be root/o3d. |
68 SOFTWARE_PATH = join(AUTO_PATH, 'software') | 52 O3D_PATH = os.path.dirname(TEST_PATH) |
| 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, 'o3d', 'build') | 72 BUILD_PATH = join(O3D_PATH, 'build') |
73 elif util.IsMac(): | 73 elif util.IsMac(): |
74 BUILD_PATH = join(O3D_PATH, 'xcodebuild') | 74 BUILD_PATH = join(BASE_PATH, 'xcodebuild') |
75 else: | 75 else: |
76 BUILD_PATH = join(O3D_PATH, 'sconsbuild') | 76 BUILD_PATH = join(BASE_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')): |
| 81 PRODUCT_DIR_PATH = join(BUILD_PATH, 'Release') |
80 else: | 82 else: |
81 PRODUCT_DIR_PATH = join(BUILD_PATH, 'Release') | 83 print 'Cannot find Debug or Release folder in ' + BUILD_PATH |
| 84 sys.exit(1) |
82 | 85 |
83 # Plugin locations. | 86 # Plugin locations. |
84 INSTALL_PATHS = [] | 87 INSTALL_PATHS = [] |
85 if util.IsWindows(): | 88 if util.IsWindows(): |
86 INSTALL_PATHS += [join(HOME_PATH, 'Application Data', 'Mozilla', | 89 INSTALL_PATHS += [join(HOME, 'Application Data', 'Mozilla', |
87 'plugins', 'npo3dautoplugin.dll')] | 90 'plugins', 'npo3dautoplugin.dll')] |
88 INSTALL_PATHS += [join(HOME_PATH, 'Application Data', 'Google', 'O3D', | 91 INSTALL_PATHS += [join(HOME, 'Application Data', 'Google', 'O3D', |
89 'o3d_host.dll')] | 92 'o3d_host.dll')] |
90 elif util.IsMac(): | 93 elif util.IsMac(): |
91 INSTALL_PATHS += ['/Library/Internet Plug-Ins/O3D.plugin'] | 94 INSTALL_PATHS += ['/Library/Internet Plug-Ins/O3D.plugin'] |
92 else: | 95 else: |
93 INSTALL_PATHS += [join(HOME_PATH, '.mozilla', 'plugins', | 96 INSTALL_PATHS += [join(HOME, '.mozilla', 'plugins', |
94 'libnpo3dautoplugin.so')] | 97 'libnpo3dautoplugin.so')] |
OLD | NEW |