1 #!/usr/bin/env python 2 3 # Copyright (c) 2012 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 """ 8 Verifies that list xcode_settings are flattened before being exported to the 9 environment. 10 """ 11 12 import TestGyp 13 14 import sys 15 16 if sys.platform == 'darwin': 17 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) 18 19 CHDIR = 'non-strs-flattened-to-env' 20 INFO_PLIST_PATH = 'Test.app/Contents/Info.plist' 21 22 test.run_gyp('test.gyp', chdir=CHDIR) 23 test.build('test.gyp', test.ALL, chdir=CHDIR) 24 info_plist = test.built_file_path(INFO_PLIST_PATH, chdir=CHDIR) 25 test.must_exist(info_plist) 26 test.must_contain(info_plist, '''\ 27 \t<key>My Variable</key> 28 \t<string>some expansion</string>''') 29 test.must_contain(info_plist, '''\ 30 \t<key>CFlags</key> 31 \t<string>-fstack-protector-all -fno-strict-aliasing -DS="A Space"</string>''') 32 33 test.pass_test() 34