1#!/usr/bin/env python 2 3# Copyright (c) 2014 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 libraries (in identical-names) are properly handeled by xcode. 9 10The names for all libraries participating in this build are: 11libtestlib.a - identical-name/testlib 12libtestlib.a - identical-name/proxy/testlib 13libproxy.a - identical-name/proxy 14The first two libs produce a hash collision in Xcode when Gyp is executed, 15because they have the same name and would be copied to the same directory with 16Xcode default settings. 17For this scenario to work one needs to change the Xcode variables SYMROOT and 18CONFIGURATION_BUILD_DIR. Setting these to per-lib-unique directories, avoids 19copying the libs into the same directory. 20 21The test consists of two steps. The first one verifies that by setting both 22vars, there is no hash collision anymore during Gyp execution and that the libs 23can actually be be built. The second one verifies that there is still a hash 24collision if the vars are not set and thus the current behavior is preserved. 25""" 26 27import TestGyp 28 29import sys 30 31def IgnoreOutput(string, expected_string): 32 return True 33 34if sys.platform == 'darwin': 35 test = TestGyp.TestGyp(formats=['xcode']) 36 37 38 test.run_gyp('test.gyp', chdir='identical-name') 39 test.build('test.gyp', test.ALL, chdir='identical-name') 40 41 test.run_gyp('test-should-fail.gyp', chdir='identical-name') 42 test.built_file_must_not_exist('test-should-fail.xcodeproj') 43 44 test.pass_test() 45 46