gyptest-non-strs-flattened-to-env.py 929 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env python
  2. # Copyright (c) 2012 Google Inc. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. """
  6. Verifies that list xcode_settings are flattened before being exported to the
  7. environment.
  8. """
  9. import TestGyp
  10. import sys
  11. if sys.platform == 'darwin':
  12. test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
  13. CHDIR = 'non-strs-flattened-to-env'
  14. INFO_PLIST_PATH = 'Test.app/Contents/Info.plist'
  15. test.run_gyp('test.gyp', chdir=CHDIR)
  16. test.build('test.gyp', test.ALL, chdir=CHDIR)
  17. info_plist = test.built_file_path(INFO_PLIST_PATH, chdir=CHDIR)
  18. test.must_exist(info_plist)
  19. test.must_contain(info_plist, '''\
  20. \t<key>My Variable</key>
  21. \t<string>some expansion</string>''')
  22. test.must_contain(info_plist, '''\
  23. \t<key>CFlags</key>
  24. \t<string>-fstack-protector-all -fno-strict-aliasing -DS="A Space"</string>''')
  25. test.pass_test()