1#!/usr/bin/env python 2 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 5# found in the LICENSE file. 6 7""" 8Verifies library_dirs (in link_settings) are properly found. 9""" 10 11import sys 12 13import TestGyp 14 15test = TestGyp.TestGyp(formats=['!android']) 16 17lib_dir = test.tempdir('secret_location') 18 19test.run_gyp('test.gyp', 20 '-D', 'abs_path_to_secret_library_location={0}'.format(lib_dir), 21 chdir='subdir') 22 23# Must build each target independently, since they are not in each others' 24# 'dependencies' (test.ALL does NOT work here for some builders, and in any case 25# would not ensure the correct ordering). 26test.build('test.gyp', 'mylib', chdir='subdir') 27test.build('test.gyp', 'libraries-search-path-test', chdir='subdir') 28 29expect = """Hello world 30""" 31test.run_built_executable( 32 'libraries-search-path-test', chdir='subdir', stdout=expect) 33 34if 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 49test.pass_test() 50test.cleanup() 51