OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2013 Google Inc. All rights reserved. | 3 # Copyright (c) 2013 Google Inc. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """ | 7 """ |
8 Verifies library_dirs (in link_settings) are properly found. | 8 Verifies library_dirs (in link_settings) are properly found. |
9 """ | 9 """ |
10 | 10 |
| 11 import sys |
| 12 |
11 import TestGyp | 13 import TestGyp |
12 | 14 |
13 test = TestGyp.TestGyp(formats=['!android']) | 15 test = TestGyp.TestGyp(formats=['!android']) |
14 | 16 |
15 lib_dir = test.tempdir('secret_location') | 17 lib_dir = test.tempdir('secret_location') |
16 | 18 |
17 test.run_gyp('test.gyp', | 19 test.run_gyp('test.gyp', |
18 '-D', 'abs_path_to_secret_library_location={0}'.format(lib_dir), | 20 '-D', 'abs_path_to_secret_library_location={0}'.format(lib_dir), |
19 chdir='subdir') | 21 chdir='subdir') |
20 | 22 |
21 # Must build each target independently, since they are not in each others' | 23 # Must build each target independently, since they are not in each others' |
22 # 'dependencies' (test.ALL does NOT work here for some builders, and in any case | 24 # 'dependencies' (test.ALL does NOT work here for some builders, and in any case |
23 # would not ensure the correct ordering). | 25 # would not ensure the correct ordering). |
24 test.build('test.gyp', 'mylib', chdir='subdir') | 26 test.build('test.gyp', 'mylib', chdir='subdir') |
25 test.build('test.gyp', 'libraries-search-path-test', chdir='subdir') | 27 test.build('test.gyp', 'libraries-search-path-test', chdir='subdir') |
26 | 28 |
27 expect = """Hello world | 29 expect = """Hello world |
28 """ | 30 """ |
29 test.run_built_executable( | 31 test.run_built_executable( |
30 'libraries-search-path-test', chdir='subdir', stdout=expect) | 32 'libraries-search-path-test', chdir='subdir', stdout=expect) |
31 | 33 |
| 34 if sys.platform in ('win32', 'cygwin'): |
| 35 test.run_gyp('test-win.gyp', |
| 36 '-D', |
| 37 'abs_path_to_secret_library_location={0}'.format(lib_dir), |
| 38 chdir='subdir') |
| 39 |
| 40 test.build('test.gyp', 'mylib', chdir='subdir') |
| 41 test.build('test-win.gyp', |
| 42 'libraries-search-path-test-lib-suffix', |
| 43 chdir='subdir') |
| 44 |
| 45 test.run_built_executable( |
| 46 'libraries-search-path-test-lib-suffix', chdir='subdir', stdout=expect) |
| 47 |
| 48 |
32 test.pass_test() | 49 test.pass_test() |
33 test.cleanup() | 50 test.cleanup() |
OLD | NEW |