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"""
8Verifies that list xcode_settings are flattened before being exported to the
9environment.
10"""
11
12import TestGyp
13
14import sys
15
16if 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